/* ============================================
   IBRAHIM AL HAZWANI — Personal Website
   Maximalist · Data Humanism Inspired
   ============================================ */

:root {
  --red:     #C0392B;
  --orange:  #D4541A;
  --yellow:  #D4A526;
  --green:   #2D6A4F;
  --teal:    #1A7D8C;
  --blue:    #2B52A6;
  --sky:     #6DB8D8;
  --navy:    #1B2C47;
  --dark:    #0A0A0A;
  --dark-2:  #111111;
  --dark-3:  #1C1C1C;
  --cream:   #F0E8D8;
  --cream-2: #E8DFC8;
  --gray:    #6B7280;
  --white:   #FFFFFF;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Space Grotesk', system-ui, sans-serif;
  --nav-h: 68px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  background: var(--dark);
  color: var(--white);
  overflow-x: hidden;
  line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ============ NAV ============ */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(10,10,10,0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  transition: border-color 0.3s var(--ease);
}

.nav-logo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.nav-logo:hover { transform: scale(1.5); box-shadow: 0 0 0 2px rgba(255,255,255,0.5); }
@keyframes nav-logo-spin {
  from { transform: scale(1.5) rotate(0deg); }
  to   { transform: scale(1.5) rotate(360deg); }
}
.nav-logo.spinning { animation: nav-logo-spin 0.35s linear 3; }

.nav-links {
  display: flex;
  gap: 2.5rem;
}
.nav-links a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  position: relative;
  transition: color 0.25s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--orange);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover { color: var(--white); }
.nav-links a:hover::after { width: 100%; }

.nav-contact {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.5rem 1.25rem;
  border: 2px solid rgba(255,255,255,0.5);
  color: var(--white);
  transition: background 0.25s, border-color 0.25s;
}
.nav-contact:hover { background: var(--white); color: var(--dark); border-color: var(--white); }

.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-hamburger span { display: block; width: 24px; height: 2px; background: var(--white); transition: all 0.3s; }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 3rem) 2.5rem 5rem;
  background: var(--dark);
  overflow: hidden;
}

.hero-circles {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.hero-circles canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 950px;
}

.hero-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 0.88;
  letter-spacing: -0.03em;
  margin-bottom: 2rem;
}
.hero-title-main {
  display: block;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--white);
}
.hero-title-secondary {
  display: block;
  font-size: clamp(2rem, 5.5vw, 3.5rem);
  color: transparent;
  -webkit-text-stroke: 2px rgba(255,255,255,0.75);
}

.hero-description {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  color: rgba(255,255,255,1);
  max-width: 580px;
  margin-bottom: 2.5rem;
  line-height: 1.75;
}

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }

.btn-primary {
  display: inline-block;
  padding: 1rem 2.25rem;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.25s, transform 0.25s;
}
.btn-primary:hover { background: var(--orange); transform: translateY(-2px); }

.btn-secondary {
  display: inline-block;
  padding: 1rem 2.25rem;
  background: transparent;
  color: var(--white);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2px solid rgba(255,255,255,0.35);
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}
.btn-secondary:hover { border-color: var(--white); background: rgba(255,255,255,0.08); transform: translateY(-2px); }

.hero-scroll {
  position: absolute;
  bottom: 4.5rem;
  left: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}
.hero-scroll-line {
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.35));
  animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  50.01% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; opacity: 0; }
}
.hero-scroll span {
  font-size: 0.5625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  writing-mode: vertical-lr;
}

/* ============ HERO NOW CIRCLES ============ */
.hero-now-playing {
  position: absolute;
  right: 5rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2rem;
  z-index: 2;
}
.hero-now-circle {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  animation: floatCircle var(--now-dur, 9s) ease-in-out infinite var(--now-delay, 0s);
}
.now-reading {
  border: 2px solid rgba(212, 165, 38, 0.7);
  background: rgba(212, 165, 38, 0.07);
  --now-dur: 10s;
  --now-delay: 0s;
}
.now-listening {
  border: 2px solid rgba(26, 125, 140, 0.7);
  background: rgba(26, 125, 140, 0.07);
  --now-dur: 12s;
  --now-delay: 1.5s;
}
.now-eyebrow {
  display: block;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 0.5rem;
}
.now-reading .now-eyebrow { color: rgba(212, 165, 38, 0.6); }
.now-listening .now-eyebrow { color: rgba(26, 125, 140, 0.7); }
.now-title {
  display: block;
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
}
.now-sub {
  display: block;
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.4);
  margin-top: 0.35rem;
  line-height: 1.35;
}

/* ============ TICKER ============ */
.ticker {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  background: rgba(255, 235, 0, 1);
  overflow: hidden;
  white-space: nowrap;
  padding: 0.875rem 0;
  border-top: 3px solid rgba(200, 180, 0, 1);
}
.ticker-track {
  display: inline-block;
  animation: ticker 28s linear infinite;
}
.ticker-track span {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(0,0,0,1);
  margin: 0 1.5rem;
}
.ticker-dot {
  font-size: 0.5rem !important;
  vertical-align: middle;
  color: rgba(0,0,0,1) !important;
  margin: 0 0.5rem !important;
}
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============ SHARED SECTION UTILS ============ */
.section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 0.625rem;
}
.section-label-light { color: rgba(255,255,255,0.35); }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.5vw, 3.75rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--dark);
  line-height: 1.05;
  margin-bottom: 3rem;
}
.section-title-light { color: var(--white); }

/* ============ ABOUT ============ */
.about {
  background: var(--cream);
  background-image: radial-gradient(circle, rgba(0,0,0,0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 7rem 2.5rem;
}

.about-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
}

.about-bio {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 1.8vw, 1.625rem);
  color: var(--dark);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}
.about-bio-secondary {
  font-size: 1.0625rem;
  color: #5a5a5a;
  line-height: 1.75;
  margin-bottom: 2.5rem;
}

.about-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  display: inline-block;
  padding: 0.35rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: transparent;
  color: var(--dark);
  border: 1.5px solid var(--dark);
  border-radius: 999px;
}
.tag-red, .tag-blue, .tag-green, .tag-orange, .tag-teal, .tag-yellow {
  background: transparent;
  color: var(--dark);
}

/* Circle grid */
.about-circle-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 2rem;
}
.about-circle {
  aspect-ratio: 1;
  border-radius: 50%;
  transition: transform 0.25s ease;
  cursor: default;
}
.about-circle:hover { transform: scale(1.25); }

/* Facts */
.about-facts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(0,0,0,0.1);
  margin-bottom: 2rem;
}
.fact {
  background: var(--dark);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
}
.fact-number {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--white);
  line-height: 1;
}
.fact-label {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.25rem;
}

/* Education */
.about-education { border-top: 2px solid rgba(0,0,0,0.12); padding-top: 1.5rem; }
.about-edu-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 1.25rem;
}
.edu-item { display: flex; gap: 1.25rem; margin-bottom: 1.25rem; }
.edu-year {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--red);
  min-width: 38px;
  padding-top: 2px;
  flex-shrink: 0;
}
.edu-item strong { display: block; font-size: 0.9375rem; color: var(--dark); margin-bottom: 0.125rem; }
.edu-item span   { display: block; font-size: 0.8125rem; color: var(--gray); }
.edu-item em     { display: block; font-size: 0.75rem; color: var(--gray); font-style: italic; margin-top: 0.125rem; }

/* ============ RESEARCH ============ */
.research {
  background: var(--dark-2);
  padding: 7rem 2.5rem;
}

.research-header {
  max-width: 1200px;
  margin: 0 auto 4rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.scholar-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--orange);
  border-bottom: 1px solid var(--orange);
  padding-bottom: 2px;
  letter-spacing: 0.05em;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.scholar-link:hover { color: var(--yellow); border-color: var(--yellow); }

.publications-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2px;
  background: rgba(255,255,255,0.04);
}

.pub-card {
  background: var(--dark-2);
  padding: 2rem;
  border-left: 4px solid transparent;
  transition: background 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
}
.pub-card:hover { background: var(--dark-3); transform: translateY(-3px); }

.pub-chi    { border-left-color: var(--red); }
.pub-vis    { border-left-color: var(--blue); }
.pub-recsys { border-left-color: var(--green); }
.pub-journal{ border-left-color: var(--orange); }
.pub-nordi  { border-left-color: var(--yellow); }
.pub-umap   { border-left-color: var(--teal); }

.pub-meta {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pub-year {
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgba(255,255,255,0.28);
  letter-spacing: 0.1em;
}
.pub-venue {
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
}
.venue-chi     { background: var(--red);    color: #fff; }
.venue-vis     { background: var(--blue);   color: #fff; }
.venue-recsys  { background: var(--green);  color: #fff; }
.venue-journal { background: var(--orange); color: #fff; }
.venue-nordi   { background: var(--yellow); color: var(--dark); }
.venue-umap    { background: var(--teal);   color: #fff; }

.pub-award-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--yellow);
  margin-left: auto;
}
.pub-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--white);
  margin-bottom: 0.875rem;
  flex: 1;
}
.pub-authors {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.38);
  line-height: 1.55;
}
.pub-authors strong { color: rgba(255,255,255,0.7); }
.pub-featured { cursor: pointer; }
.pub-featured:hover { background: var(--dark-3); transform: translateY(-3px); }
.pub-read-more {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  transition: color 0.2s;
}
.pub-featured:hover .pub-read-more { color: var(--orange); }

.pub-venue-full {
  font-size: 0.6875rem;
  color: rgba(255,255,255,0.25);
  font-style: italic;
  margin-top: 0.5rem;
}

/* ============ WORK ============ */
.work {
  background: var(--cream);
  background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
  padding: 7rem 2.5rem;
}
.work-inner { max-width: 1200px; margin: 0 auto; }
.work-header { margin-bottom: 4rem; }
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
}

.work-column-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gray);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.work-item { margin-bottom: 2.25rem; }
.work-item-header { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 0.625rem; }
.work-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.work-period { font-size: 0.6875rem; font-weight: 600; color: var(--gray); letter-spacing: 0.05em; display: block; margin-bottom: 0.2rem; }
.work-role { font-size: 1rem; font-weight: 700; color: var(--dark); margin-bottom: 0.15rem; }
.work-org  { font-size: 0.8125rem; color: var(--gray); }
.work-bullets { padding-left: 1.5rem; margin-top: 0.5rem; }
.work-bullets li { font-size: 0.875rem; color: #5a5a5a; line-height: 1.65; margin-bottom: 0.3rem; list-style: disc; }

.teaching-list { display: flex; flex-direction: column; gap: 0.875rem; }
.teaching-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 0.875rem;
  border-bottom: 1px solid rgba(0,0,0,0.07);
}
.teaching-course { font-size: 0.9375rem; font-weight: 600; color: var(--dark); line-height: 1.4; }
.teaching-meta   { font-size: 0.75rem; color: var(--gray); text-align: right; flex-shrink: 0; }

.talks-list { display: flex; flex-direction: column; gap: 1rem; }
.talk-item  { display: flex; gap: 1rem; align-items: flex-start; }
.talk-year  { font-size: 0.75rem; font-weight: 700; color: var(--red); min-width: 34px; padding-top: 2px; flex-shrink: 0; }
.talk-desc  { font-size: 0.9375rem; color: var(--dark); line-height: 1.5; }

.service-tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.5rem; }
.service-tag {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: rgba(0,0,0,0.07);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--dark);
  letter-spacing: 0.03em;
}

/* ============ CV SECTION ============ */
.cv-section {
  background: var(--orange);
  padding: 7rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.cv-circles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.cv-content {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 3rem;
}
.skill-tag {
  display: inline-block;
  padding: 0.5rem 1.125rem;
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,0.22);
  letter-spacing: 0.03em;
  transition: background 0.2s;
}
.skill-tag:hover { background: rgba(255,255,255,0.22); }

.cv-download-btn {
  display: inline-block;
  padding: 1.125rem 3rem;
  background: var(--white);
  color: var(--blue);
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: background 0.25s, color 0.25s, transform 0.25s;
}
.cv-download-btn:hover { background: var(--dark); color: var(--white); transform: translateY(-3px); }

/* ============ FOOTER ============ */
.footer {
  background: var(--dark);
  padding: 6rem 2.5rem 4rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-content { max-width: 1200px; margin: 0 auto; }

.footer-cta {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 900;
  color: var(--white);
  line-height: 1.05;
  margin-bottom: 1.25rem;
}
.footer-email {
  display: inline-block;
  font-size: clamp(1rem, 1.75vw, 1.375rem);
  font-weight: 600;
  color: var(--orange);
  border-bottom: 2px solid var(--orange);
  padding-bottom: 3px;
  margin-bottom: 3rem;
  transition: color 0.2s, border-color 0.2s;
}
.footer-email:hover { color: var(--yellow); border-color: var(--yellow); }

.footer-links { display: flex; gap: 2rem; margin-bottom: 4rem; }
.footer-links a {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  transition: color 0.2s;
}
.footer-links a:hover { color: var(--white); }

.footer-bottom {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.18);
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 2rem;
  letter-spacing: 0.04em;
}

/* ============ SCROLL ANIMATIONS ============ */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .nav-links   { display: none; }
  .nav-contact { display: none; }
  .nav-hamburger { display: flex; }
  .hero-now-playing { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--dark-2);
    padding: 2rem 2.5rem;
    gap: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.07);
  }
  .about-grid  { grid-template-columns: 1fr; gap: 3rem; }
  .work-grid   { grid-template-columns: 1fr; gap: 3rem; }
  .publications-grid { grid-template-columns: 1fr; }
  .research-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .nav { padding: 0 1.5rem; }
  .hero { padding: calc(var(--nav-h) + 1.5rem) 1.5rem 4rem; }
  .hero-title-secondary { -webkit-text-stroke-width: 1.5px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .about, .research, .work, .cv-section, .footer { padding-left: 1.5rem; padding-right: 1.5rem; }
  .about-facts { grid-template-columns: repeat(2, 1fr); }
  .teaching-item { flex-direction: column; gap: 0.25rem; }
  .teaching-meta { text-align: left; }
  .work-grid { gap: 2.5rem; }
}
