/* =======================================================================
   IBRAHIM AMIN — DATA / AI PORTFOLIO
   Design concept: the page itself is framed as a data pipeline.
   Each section is a stage — Ingest, Clean, Engineer, Train, Validate,
   Test, Deploy — echoing the pipeline Ibrahim uses in his own notebooks
   (Data -> Cleaning -> EDA -> Feature Engineering -> Training -> Evaluation).
   A vertical "pipeline rail" on desktop (a slim top bar on mobile) tracks
   scroll progress through these stages.
   ======================================================================= */

/* ---------- Design tokens ---------- */
:root{
  --ink:        #12151B;   /* page background */
  --ink-soft:   #1B2029;   /* panels / cards */
  --ink-soft-2: #21283380; /* translucent panel (glass) */
  --paper:      #EDEDE6;   /* primary text */
  --muted:      #8891A0;   /* secondary text */
  --line:       #2A303C;   /* hairlines */
  --amber:      #E8A33D;   /* primary accent — signal line */
  --amber-soft: #E8A33D26;
  --teal:       #4FB6A6;   /* secondary accent — second series */
  --teal-soft:  #4FB6A626;

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --rail-w: 88px;
  --max: 1180px;
}

@media (prefers-reduced-motion: reduce){
  *{ animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

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

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

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

a{ color: inherit; }

::selection{ background: var(--amber); color: #12151B; }

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

/* faint graph-paper texture across the whole page */
.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.16;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent 75%);
}

.wrap{ max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

section{ position: relative; z-index: 1; }

/* ---------- Pipeline rail (desktop) ---------- */
.rail{
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 34px;
  z-index: 50;
  background: linear-gradient(180deg, transparent, #12151Bcc 12%, #12151Bcc 88%, transparent);
}

.rail__line{
  position: absolute;
  left: 50%; top: 8%; bottom: 8%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--line);
}

.rail__fill{
  position: absolute;
  left: 50%; top: 8%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--amber), var(--teal));
  height: 0%;
  transition: height 0.15s linear;
}

.rail__node{
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  font-family: var(--mono);
  color: var(--muted);
}

.rail__dot{
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--ink-soft);
  border: 2px solid var(--line);
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.rail__label{
  position: absolute;
  left: 26px;
  white-space: nowrap;
  font-size: 12.5px;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.rail__node:hover .rail__label,
.rail__node.is-active .rail__label{
  opacity: 1;
  transform: translateX(0);
}

.rail__node.is-active .rail__dot{
  background: var(--amber);
  border-color: var(--amber);
  box-shadow: 0 0 0 5px var(--amber-soft);
}

.rail__node.is-active .rail__label{ color: var(--amber); }

/* mobile progress bar replaces the rail */
.topbar{
  display: none;
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 50;
  background: var(--line);
}
.topbar__fill{
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transition: width 0.1s linear;
}
.topbar__label{
  display: none;
  position: fixed; top: 10px; left: 16px; z-index: 50;
  font-family: var(--mono); font-size: 11.5px; color: var(--amber);
  background: #12151Be0; padding: 4px 10px; border-radius: 20px;
  border: 1px solid var(--line);
}

@media (max-width: 900px){
  .rail{ display: none !important; }
  .topbar, .topbar__label{ display: block !important; }
  body{ padding-left: 0; }
}
@media (min-width: 901px){
  main{ margin-left: var(--rail-w); }
}

/* ---------- Reveal-on-scroll ---------- */
.reveal{
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(.2,.7,.2,1), transform 0.7s cubic-bezier(.2,.7,.2,1);
}
.reveal.is-visible{ opacity: 1; transform: translateY(0); }

/* ---------- Stage label (the "pipeline" eyebrow, sentence case not caps) ---------- */
.stage{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--teal);
  margin-bottom: 18px;
}
.stage::before{
  content: "";
  width: 18px; height: 1px;
  background: var(--teal);
}

h1, h2, h3{ font-family: var(--display); font-weight: 600; margin: 0; color: var(--paper); }

h2.title{
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.15;
  max-width: 14ch;
  margin-bottom: 14px;
}

p.lede{
  color: var(--muted);
  max-width: 62ch;
  font-size: 1.05rem;
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 26px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}
.btn--primary{
  background: var(--amber);
  color: #17140C;
}
.btn--primary:hover{ transform: translateY(-2px); box-shadow: 0 10px 30px -8px var(--amber-soft); }
.btn--ghost{
  background: transparent;
  border-color: var(--line);
  color: var(--paper);
}
.btn--ghost:hover{ border-color: var(--teal); color: var(--teal); transform: translateY(-2px); }

/* =======================================================================
   HERO
   ======================================================================= */
.hero{
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 140px 0 80px;
}
.hero__grid{
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(30px, 6vw, 80px);
  align-items: center;
}
.hero__kicker{
  font-family: var(--mono);
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 22px;
}
.hero__kicker b{ color: var(--amber); font-weight: 600; }

.hero h1{
  font-size: clamp(2.6rem, 5.6vw, 4.4rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
}
.hero h1 em{
  font-style: italic;
  color: var(--amber);
}

.hero__tag{
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.15rem;
  max-width: 46ch;
}

.hero__ctas{
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__portrait{
  position: relative;
  aspect-ratio: 1 / 1.05;
  justify-self: center;
  width: min(420px, 100%);
}

.hero__frame{
  position: absolute; inset: 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px -30px #00000090;
}
.hero__frame img{ width: 100%; height: 100%; object-fit: cover; }

.hero__frame::after{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, #12151Bd0 100%);
}

.orbit-icon{
  position: absolute;
  width: 52px; height: 52px;
  border-radius: 14px;
  background: #1B2029d9;
  border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: float 7s ease-in-out infinite;
  box-shadow: 0 12px 28px -12px #000000a0;
}
.orbit-icon svg{ width: 24px; height: 24px; }
.orbit-icon.i-py   { top: -6%;  left: -12%; animation-delay: 0s;   color: var(--amber); }
.orbit-icon.i-sql  { top: 12%;  right: -14%; animation-delay: 1.1s; color: var(--teal); }
.orbit-icon.i-ml   { top: 46%;  left: -18%; animation-delay: 2.2s; color: var(--amber); }
.orbit-icon.i-viz  { bottom: 10%; right: -12%; animation-delay: 0.6s; color: var(--teal); }
.orbit-icon.i-agri { bottom: -8%; left: 8%;  animation-delay: 1.7s; color: var(--amber); }
.orbit-icon.i-lang { top: -8%; right: 16%; animation-delay: 2.9s; color: var(--teal); }

@keyframes float{
  0%, 100%{ transform: translateY(0) rotate(0deg); }
  50%{ transform: translateY(-14px) rotate(3deg); }
}

.scroll-cue{
  position: absolute;
  bottom: 34px; left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}
.scroll-cue__wheel{
  width: 22px; height: 36px;
  border-radius: 20px;
  border: 1px solid var(--line);
  position: relative;
}
.scroll-cue__wheel::after{
  content: "";
  position: absolute; top: 6px; left: 50%;
  width: 4px; height: 8px; border-radius: 3px;
  background: var(--amber);
  transform: translateX(-50%);
  animation: scrolldown 1.8s ease-in-out infinite;
}
@keyframes scrolldown{
  0%{ opacity: 1; top: 6px; }
  70%{ opacity: 0; top: 18px; }
  100%{ opacity: 0; top: 18px; }
}

@media (max-width: 900px){
  .hero{ padding-top: 100px; }
  .hero__grid{ grid-template-columns: 1fr; }
  .hero__portrait{ order: -1; width: min(280px, 70vw); margin: 0 auto 20px; }
  .orbit-icon{ width: 42px; height: 42px; }
}

/* =======================================================================
   ABOUT
   ======================================================================= */
.about{ padding: 130px 0; }
.about__grid{
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(30px, 6vw, 70px);
}
.about__lines p{
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 20px;
}
.about__lines strong{ color: var(--paper); font-weight: 600; }

.stat-row{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 34px;
}
.stat{
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.stat b{
  display: block;
  font-family: var(--display);
  font-size: 2rem;
  color: var(--amber);
}
.stat span{ color: var(--muted); font-size: 0.88rem; }

.about__panel{
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(24px, 4vw, 40px);
  position: relative;
  overflow: hidden;
}
.about__panel::before{
  content: "";
  position: absolute; top: -60px; right: -60px;
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, var(--teal-soft), transparent 70%);
}
.about__panel h3{ font-size: 1.4rem; margin-bottom: 18px; }
.about__list{ list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.about__list li{
  display: flex; gap: 12px; align-items: flex-start;
  color: var(--muted); font-size: 0.95rem;
}
.about__list li svg{ flex-shrink: 0; margin-top: 3px; width: 16px; height: 16px; color: var(--teal); }
.about__list b{ color: var(--paper); font-weight: 600; }

@media (max-width: 900px){
  .about__grid{ grid-template-columns: 1fr; }
  .stat-row{ grid-template-columns: 1fr 1fr; }
}

/* =======================================================================
   SKILLS
   ======================================================================= */
.skills{ padding: 130px 0; }
.skills__head{ max-width: 640px; margin-bottom: 56px; }

.skill-groups{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}

.skill-card{
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.skill-card:hover{
  transform: translateY(-6px);
  border-color: var(--amber);
  box-shadow: 0 20px 40px -20px var(--amber-soft);
}
.skill-card__icon{
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal);
  margin-bottom: 18px;
}
.skill-card__icon svg{ width: 20px; height: 20px; }
.skill-card h3{ font-size: 1.05rem; margin-bottom: 12px; }

.chip-row{ display: flex; flex-wrap: wrap; gap: 8px; }
.chip{
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 5px 12px;
  transition: color 0.2s, border-color 0.2s;
}
.skill-card:hover .chip{ color: var(--paper); }
.chip:hover{ border-color: var(--teal); color: var(--teal) !important; }

/* =======================================================================
   PROJECTS
   ======================================================================= */
.projects{ padding: 130px 0; }
.projects__head{ max-width: 680px; margin-bottom: 56px; }

.project-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.project-card{
  background: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 4px 16px 16px 16px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}
.project-card:hover{
  transform: translateY(-8px);
  border-color: var(--teal);
  box-shadow: 0 26px 50px -24px #00000090;
}
.project-card__bar{
  display: flex; align-items: center; gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
}
.project-card__bar span{
  width: 8px; height: 8px; border-radius: 50%; background: var(--line);
}
.project-card__body{ padding: 22px 24px 26px; flex: 1; display: flex; flex-direction: column; }
.project-card h3{ font-size: 1.25rem; margin-bottom: 10px; }
.project-card p{ color: var(--muted); font-size: 0.94rem; margin: 0 0 16px; flex: 1; }

.metric-row{
  display: flex; gap: 18px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.metric{ font-family: var(--mono); font-size: 12px; color: var(--teal); }
.metric b{ color: var(--amber); font-size: 1rem; display: block; font-family: var(--display); }

.project-card__links{ display: flex; gap: 14px; margin-top: auto; }
.project-card__links a{
  font-size: 0.85rem; font-weight: 600; color: var(--paper);
  text-decoration: none; border-bottom: 1px solid var(--amber);
  padding-bottom: 2px;
}
.project-card__links a:hover{ color: var(--amber); }

/* =======================================================================
   TIMELINE
   ======================================================================= */
.timeline-section{ padding: 130px 0; }
.timeline-section__head{ max-width: 640px; margin-bottom: 56px; }

.timeline{ position: relative; padding-left: 34px; }
.timeline::before{
  content: "";
  position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(180deg, var(--amber), var(--teal));
  opacity: 0.5;
}
.tl-item{ position: relative; padding-bottom: 46px; }
.tl-item:last-child{ padding-bottom: 0; }
.tl-item::before{
  content: "";
  position: absolute; left: -34px; top: 4px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--amber);
}
.tl-item__date{ font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.tl-item h3{ font-size: 1.15rem; margin-bottom: 6px; }
.tl-item p{ color: var(--muted); font-size: 0.95rem; max-width: 62ch; margin: 0; }

/* =======================================================================
   CERTIFICATIONS + VOLUNTEER
   ======================================================================= */
.extra{ padding: 130px 0; }
.extra__grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(24px, 4vw, 50px);
}
.extra__col h3{
  font-size: 1.3rem;
  margin-bottom: 24px;
  display: flex; align-items: center; gap: 12px;
}
.extra__col h3 svg{ width: 22px; height: 22px; color: var(--amber); }

.cert-card, .vol-card{
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--ink-soft);
}
.cert-card__top, .vol-card__top{
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 0.98rem; font-weight: 600; margin-bottom: 4px;
}
.cert-card__date, .vol-card__date{ font-family: var(--mono); font-size: 12px; color: var(--teal); white-space: nowrap; }
.cert-card p, .vol-card p{ margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

@media (max-width: 900px){ .extra__grid{ grid-template-columns: 1fr; } }

/* =======================================================================
   FINAL CTA
   ======================================================================= */
.finale{
  padding: 150px 0 110px;
  text-align: center;
  position: relative;
}
.finale__ring{
  position: absolute; left: 50%; top: 10%;
  width: 480px; height: 480px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--amber-soft), transparent 70%);
  pointer-events: none;
}
.finale h2{
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 16ch;
  margin: 0 auto 20px;
  line-height: 1.12;
}
.finale p.lede{ margin: 0 auto 40px; }
.finale .hero__ctas{ justify-content: center; }

/* =======================================================================
   FOOTER
   ======================================================================= */
footer{
  border-top: 1px solid var(--line);
  padding: 46px 0 60px;
}
.foot__grid{
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px;
  align-items: flex-end;
}
.foot__brand{ font-family: var(--display); font-size: 1.3rem; }
.foot__contacts{ display: flex; flex-wrap: wrap; gap: 22px; }
.foot__contacts a{
  color: var(--muted); text-decoration: none; font-size: 0.92rem;
  display: flex; align-items: center; gap: 8px;
}
.foot__contacts a:hover{ color: var(--amber); }
.foot__contacts svg{ width: 16px; height: 16px; }
.foot__meta{ color: var(--muted); font-size: 0.8rem; font-family: var(--mono); margin-top: 30px; }

@media (max-width: 900px){
  .foot__grid{ flex-direction: column; align-items: flex-start; }
}
