:root {
  --bg: #000000;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #e4002b;
  --accent-soft: rgba(228, 0, 43, 0.18);
  --border: rgba(255, 255, 255, 0.08);
  --font: "Inter", system-ui, sans-serif;
  --display: "Bebas Neue", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.about,
.work,
.skills,
.experience,
.contact {
  content-visibility: auto;
  contain-intrinsic-size: auto 600px;
}

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

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 5vw, 48px);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}

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

.nav__brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav__logo {
  display: block;
  width: auto;
  height: clamp(52px, 8vw, 72px);
  max-width: min(340px, 62vw);
  object-fit: contain;
  object-position: center;
}

.nav__links {
  display: none;
  gap: 28px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

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

.nav__cta {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  color: var(--accent);
  transition: background 0.25s, color 0.25s;
}

.nav__cta:hover {
  background: var(--accent);
  color: #fff;
}

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

.nav__lang {
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 9px 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}

.nav__lang:hover {
  border-color: var(--accent);
  color: var(--accent);
}

html[lang="ar"] body {
  font-family: "Tajawal", "Inter", system-ui, sans-serif;
}

html[dir="rtl"] .timeline {
  border-left: none;
  border-right: 2px solid var(--accent);
  padding-left: 0;
  padding-right: 28px;
}

html[dir="rtl"] .experience-projects li {
  padding-left: 0;
  padding-right: 18px;
}

html[dir="rtl"] .experience-projects li::before {
  left: auto;
  right: 0;
}

html[dir="rtl"] .about__facts li {
  grid-template-columns: 100px 1fr;
}

html[dir="rtl"] .project--reverse .project__meta {
  order: unset;
}

@media (min-width: 960px) {
  html[dir="rtl"] .project--reverse .project__meta {
    order: 2;
  }

  html[dir="rtl"] .project--reverse .project__shot {
    order: 1;
  }
}

@media (min-width: 900px) {
  .nav__links {
    display: flex;
  }
}

/* Hero */
.hero {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 120px clamp(20px, 5vw, 64px) 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero__grid {
  display: grid;
  gap: 48px;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

@media (min-width: 960px) {
  .hero__grid {
    grid-template-columns: 1fr 0.9fr;
    gap: 64px;
  }
}

@media (max-width: 959px) {
  .hero {
    padding-top: 100px;
    justify-content: flex-start;
  }

  .hero__grid {
    display: flex;
    flex-direction: column;
  }

  .hero__visual {
    order: -1;
    height: min(52vh, 420px);
    margin-bottom: 8px;
  }

  .hero__copy {
    order: 0;
    text-align: center;
  }

  .hero__lead {
    margin-inline: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.hero__title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 20px;
}

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

.hero__lead {
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 28px;
  font-size: 1.05rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 2px;
  transition: transform 0.2s, background 0.25s, color 0.25s;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn--ghost {
  border: 1px solid var(--border);
  color: var(--text);
}

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

.hero__stats {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}

.hero__stats li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hero__stats strong {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent);
}

.hero__stats span {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero__visual {
  position: relative;
  width: min(100%, 440px);
  height: min(78vh, 560px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero__ring {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent) 0%, #8b0018 52%, transparent 70%);
  filter: blur(2px);
  opacity: 0.95;
  z-index: 0;
  animation: pulse-ring 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-ring {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.04);
    opacity: 1;
  }
}

.hero__portrait {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: contrast(1.03) saturate(1.02);
  pointer-events: none;
}

.scroll-hint {
  margin: 48px auto 0;
  width: 1px;
  height: 56px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0.5;
}

/* Marquee */
.strip {
  border-block: 1px solid var(--border);
  padding: 18px 0;
  overflow: hidden;
}

.marquee {
  display: flex;
  gap: 40px;
  width: max-content;
  animation: marquee 28s linear infinite;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.marquee span::after {
  content: "•";
  margin-left: 40px;
  color: var(--accent);
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* Sections */
.section-tag {
  font-family: var(--display);
  font-size: clamp(4rem, 12vw, 7rem);
  line-height: 0.9;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin: 0 0 32px;
  font-weight: 400;
}

.about,
.work,
.skills,
.experience,
.contact {
  padding: clamp(72px, 12vw, 120px) clamp(20px, 5vw, 64px);
  max-width: 1280px;
  margin: 0 auto;
}

.about__grid {
  display: grid;
  gap: 48px;
  align-items: center;
}

@media (min-width: 900px) {
  .about__grid {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 72px;
  }
}

.about__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.about__portrait {
  width: 100%;
  max-height: 560px;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center center;
  border: none;
  outline: none;
  box-shadow: none;
  background: transparent;
  /* soften outer edges only — photo stays exactly as uploaded */
  -webkit-mask-image: radial-gradient(
    ellipse 96% 94% at 50% 48%,
    #000 78%,
    rgba(0, 0, 0, 0.85) 90%,
    transparent 100%
  );
  mask-image: radial-gradient(
    ellipse 96% 94% at 50% 48%,
    #000 78%,
    rgba(0, 0, 0, 0.85) 90%,
    transparent 100%
  );
}

.about__copy p {
  color: var(--muted);
  margin: 0 0 18px;
  font-size: 1.02rem;
}

.about__copy strong {
  color: var(--text);
}

.about__facts {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  border-top: 1px solid var(--border);
}

.about__facts li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
  color: var(--muted);
}

.about__facts span {
  color: var(--accent);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Projects */
.work__head {
  margin-bottom: 56px;
}

.work__intro {
  color: var(--muted);
  margin: -12px 0 0;
  font-size: 1.1rem;
}

.project {
  display: grid;
  gap: 40px;
  align-items: center;
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 960px) {
  .project {
    grid-template-columns: 1fr 1.15fr;
    gap: 64px;
  }

  .project--reverse .project__meta {
    order: 2;
  }

  .project--reverse .project__shot {
    order: 1;
  }
}

.project__index {
  font-family: var(--display);
  font-size: 2.5rem;
  color: var(--accent);
  line-height: 1;
}

.project h3 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 8px 0 4px;
  letter-spacing: -0.02em;
}

.project__role {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 16px;
}

.project__meta > p {
  color: var(--muted);
  margin: 0 0 20px;
}

.project__tags {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project__tags li {
  font-size: 0.72rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  color: var(--muted);
  letter-spacing: 0.06em;
}

.project__link {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
}

.project__link:hover {
  text-decoration: underline;
}

.project__shot {
  position: relative;
  border: 1px solid var(--border);
  background: #0a0a0a;
  overflow: hidden;
  border-radius: 4px;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.55);
}

.project__shot::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 28px;
  background: linear-gradient(90deg, #1a1a1a, #0d0d0d);
  border-bottom: 1px solid var(--border);
  z-index: 3;
  pointer-events: none;
}

.project__carousel-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  margin-top: 28px;
  background: #050505;
}

.project__carousel-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: opacity 0.35s ease;
  opacity: 1;
}

.project__carousel-ui {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), transparent);
}

.project__carousel-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project__carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 60%;
}

.project__carousel-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.project__carousel-dot.is-active {
  background: var(--accent);
  transform: scale(1.15);
}

.project__shot--glow::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% -20%;
  height: 40%;
  background: radial-gradient(ellipse, rgba(0, 229, 191, 0.2), transparent 70%);
  pointer-events: none;
}

/* Skills */
.skills__grid {
  display: grid;
  gap: 20px;
}

@media (min-width: 700px) {
  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1000px) {
  .skills__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.skill-card {
  padding: 28px;
  border: 1px solid var(--border);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03), transparent);
  transition: border-color 0.3s;
}

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

.skill-card--highlight {
  border-color: rgba(228, 0, 43, 0.45);
  background: linear-gradient(145deg, rgba(228, 0, 43, 0.1), transparent);
}

.skill-card--highlight:hover {
  border-color: var(--accent);
}

.skill-card h4 {
  margin: 0 0 10px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.skill-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Timeline */
.timeline {
  border-left: 2px solid var(--accent);
  padding-left: 28px;
}

.timeline__item {
  margin-bottom: 36px;
}

.timeline__item--highlight {
  padding: 20px 22px;
  border: 1px solid rgba(228, 0, 43, 0.35);
  background: linear-gradient(145deg, rgba(228, 0, 43, 0.08), transparent);
  border-radius: 4px;
}

.timeline__item--highlight h4 {
  color: var(--accent);
  margin-bottom: 10px;
}

.timeline__item--highlight p {
  margin: 0 0 14px;
  color: var(--text);
  line-height: 1.7;
}

.vibe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.vibe-list li {
  position: relative;
  padding-inline-start: 18px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
}

.vibe-list li::before {
  content: "▸";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  color: var(--accent);
  line-height: 1.5;
}

.timeline__item time {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline__item h4 {
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.timeline__item p {
  margin: 0;
  color: var(--muted);
}

.experience-projects {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.experience-projects li {
  position: relative;
  padding-left: 18px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

.experience-projects li::before {
  content: "•";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-size: 1.15rem;
  line-height: 1.4;
}

.experience-projects strong {
  color: var(--accent);
  font-weight: 700;
}

/* Contact */
.contact {
  text-align: center;
  padding-bottom: 64px;
}

.contact__lead {
  color: var(--muted);
  font-size: 1.15rem;
  margin: -8px 0 32px;
}

.contact__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  font-size: 1.05rem;
}

.contact__grid a:hover {
  color: var(--accent);
}

.footer__copy {
  margin-top: 48px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

/* Reveal */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay {
  transition-delay: 0.12s;
}
