/* ============================================================
   SMILE — Studio Portfolio · 2026 redesign
   Ink black · electric lime · editorial Arabic typography
   ============================================================ */

:root {
  --bg: #08080a;
  --bg2: #0e0e12;
  --ink: #121216;
  --text: #f4f1e8;
  --text-dim: #9a978f;
  --lime: #d4ff3f;
  --lime-ink: #0a0a0c;
  --lime-dim: rgba(212, 255, 63, 0.12);
  --c2: var(--lime); /* legacy alias (legal pages) */
  --surface: rgba(244, 241, 232, 0.04);
  --surface-border: rgba(244, 241, 232, 0.1);
  --radius: 26px;
  --font-display: "Alexandria", "Cairo", sans-serif;
  --font-body: "IBM Plex Sans Arabic", "Tajawal", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

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

::selection { background: var(--lime); color: var(--lime-ink); }

img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; }

/* ---------- film grain + ambient glow ---------- */
.grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none; z-index: 2000;
  opacity: 0.055;
  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.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 9s steps(10) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

.aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 30% at 82% 12%, rgba(212, 255, 63, 0.07), transparent 70%),
    radial-gradient(42% 36% at 12% 78%, rgba(124, 92, 255, 0.06), transparent 70%),
    var(--bg);
}

/* ---------- loader ---------- */
.loader {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}
.loader.hidden { opacity: 0; visibility: hidden; }
.loader__word {
  font-family: var(--font-display);
  font-weight: 800; font-size: clamp(2rem, 7vw, 3.4rem);
  letter-spacing: 0.08em; color: var(--text);
}
.loader__word span { color: var(--lime); }
.loader__bar {
  width: min(220px, 50vw); height: 2px;
  background: var(--surface-border); overflow: hidden; border-radius: 2px;
}
.loader__bar::after {
  content: ""; display: block; height: 100%; width: 40%;
  background: var(--lime);
  animation: loadbar 1.1s var(--ease) infinite;
}
@keyframes loadbar {
  from { transform: translateX(120%); }
  to { transform: translateX(-280%); }
}

/* ---------- custom cursor ---------- */
.cursor, .cursor-dot { display: none; }
@media (hover: hover) and (pointer: fine) {
  .cursor {
    display: block; position: fixed; top: 0; left: 0; z-index: 4000;
    width: 38px; height: 38px; border-radius: 50%;
    border: 1.5px solid rgba(212, 255, 63, 0.65);
    pointer-events: none;
    transition: width 0.25s, height 0.25s, background 0.25s, border-color 0.25s;
  }
  .cursor.is-hover {
    width: 64px; height: 64px;
    background: rgba(212, 255, 63, 0.1);
    border-color: var(--lime);
  }
  .cursor-dot {
    display: block; position: fixed; top: 0; left: 0; z-index: 4001;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--lime); pointer-events: none;
  }
}

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; right: 0; left: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px clamp(20px, 5vw, 56px);
  transition: background 0.4s, padding 0.4s, border-color 0.4s;
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  padding: 12px clamp(20px, 5vw, 56px);
  background: rgba(8, 8, 10, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--surface-border);
}
.nav__logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.45rem; letter-spacing: 0.04em;
}
.nav__logo span { color: var(--lime); }
.nav__links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav__links a {
  position: relative; font-size: 0.95rem; font-weight: 500;
  color: var(--text-dim); transition: color 0.3s;
}
.nav__links a::after {
  content: ""; position: absolute; right: 0; bottom: -6px;
  width: 0; height: 2px; background: var(--lime);
  transition: width 0.35s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a:hover::after { width: 100%; }
.nav__links .nav__lab {
  padding: 7px 18px; border-radius: 999px;
  border: 1.5px solid rgba(212, 255, 63, 0.55);
  color: var(--lime); font-weight: 600;
  transition: background 0.3s, color 0.3s;
}
.nav__links .nav__lab::after { display: none; }
.nav__links .nav__lab:hover { background: var(--lime); color: var(--lime-ink); }
.nav__burger { display: none; }

@media (max-width: 760px) {
  .nav__burger {
    display: flex; flex-direction: column; gap: 5px;
    background: none; border: 0; cursor: pointer; padding: 8px; z-index: 1002;
  }
  .nav__burger span {
    width: 24px; height: 2px; background: var(--text);
    transition: transform 0.35s var(--ease), opacity 0.3s;
  }
  .nav__burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.open span:nth-child(2) { opacity: 0; }
  .nav__burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav__links {
    position: fixed; inset: 0; z-index: 1001;
    flex-direction: column; align-items: center; justify-content: center; gap: 34px;
    background: rgba(8, 8, 10, 0.96); backdrop-filter: blur(20px);
    opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
  }
  .nav__links.open { opacity: 1; visibility: visible; }
  .nav__links a { font-size: 1.6rem; font-family: var(--font-display); font-weight: 700; color: var(--text); }
}

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 110px clamp(20px, 5vw, 56px) 40px;
  overflow: hidden;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 1.4s ease;
  filter: saturate(0.95);
}
.hero__bg.ready { opacity: 0.85; }
.hero__overlay {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to top, var(--bg) 3%, rgba(8, 8, 10, 0.25) 40%, rgba(8, 8, 10, 0.45) 100%);
}
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.92rem; font-weight: 500; color: var(--lime);
  letter-spacing: 0.06em; margin-bottom: 18px;
}
.hero__eyebrow::before {
  content: ""; width: 34px; height: 1.5px; background: var(--lime);
}
.hero__title {
  font-size: clamp(3rem, 11.5vw, 8.6rem);
  font-weight: 800; line-height: 1.04;
  margin-bottom: clamp(20px, 3vw, 34px);
}
.hero__title .line { display: block; }
.hero__title .line--ghost {
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(244, 241, 232, 0.55);
}
.hero__title .line--lime { color: var(--lime); }
.hero__sub {
  max-width: 520px; color: var(--text-dim);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  margin-bottom: clamp(26px, 4vw, 40px);
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: clamp(60px, 9vw, 110px); }

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 32px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 1rem;
  border: 1.5px solid transparent; cursor: pointer;
  transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
  will-change: transform;
}
.btn--primary { background: var(--lime); color: var(--lime-ink); }
.btn--primary:hover { transform: translateY(-3px); }
.btn--ghost { border-color: var(--surface-border); color: var(--text); }
.btn--ghost:hover { border-color: var(--lime); color: var(--lime); transform: translateY(-3px); }

.hero__scroll {
  position: absolute; bottom: 110px; left: clamp(20px, 5vw, 56px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.14em;
}
.hero__scroll span {
  width: 1.5px; height: 44px;
  background: linear-gradient(var(--lime), transparent);
  animation: scrollhint 1.8s ease-in-out infinite;
}
@keyframes scrollhint {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}
@media (max-width: 760px) { .hero__scroll { display: none; } }

/* ---------- marquee ---------- */
.marquee {
  position: relative; z-index: 5;
  background: var(--lime); color: var(--lime-ink);
  transform: rotate(-1.4deg) scale(1.02);
  padding: 13px 0; overflow: hidden;
  margin-top: -28px;
}
.marquee__track {
  display: flex; width: max-content;
  animation: marquee 26s linear infinite;
}
.marquee__track > span {
  display: flex; align-items: center; gap: 26px;
  padding-inline-end: 26px;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(0.95rem, 2.4vw, 1.2rem);
  white-space: nowrap;
}
.marquee__track i { font-style: normal; font-size: 0.7em; }
@keyframes marquee { to { transform: translateX(50%); } }

/* ---------- sections ---------- */
.section { padding: clamp(90px, 13vw, 170px) clamp(20px, 5vw, 56px); }
.section__head { margin-bottom: clamp(50px, 8vw, 90px); max-width: 900px; }
.section__kicker {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--lime); font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.06em; margin-bottom: 14px;
}
.section__kicker::before { content: ""; width: 30px; height: 1.5px; background: var(--lime); }
.section__title {
  font-size: clamp(2.2rem, 7vw, 4.6rem);
  font-weight: 800; line-height: 1.12;
}
.section__title .ghost {
  color: transparent;
  -webkit-text-stroke: 1.3px rgba(244, 241, 232, 0.5);
}
.section__lead { color: var(--text-dim); max-width: 560px; margin-top: 16px; }

/* ---------- work (projects) ---------- */
.work { display: flex; flex-direction: column; gap: clamp(80px, 13vw, 180px); }
.work-item {
  position: relative;
  display: grid; gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
.work-item__num {
  position: absolute; top: -0.55em; inset-inline-start: -0.06em; z-index: 0;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(5.5rem, 16vw, 12rem); line-height: 1;
  color: transparent; -webkit-text-stroke: 1.2px rgba(244, 241, 232, 0.13);
  pointer-events: none; user-select: none;
}
.work-item__media {
  position: relative; z-index: 1;
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--ink);
  border: 1px solid var(--surface-border);
  transform: translateZ(0);
}
.work-item__media video,
.work-item__media img {
  width: 100%; height: 112%; object-fit: cover;
  will-change: transform;
}
.work-item__media::after {
  content: ""; position: absolute; inset: 0;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(244, 241, 232, 0.06), inset 0 -80px 120px -60px rgba(8, 8, 10, 0.55);
  pointer-events: none;
}
.work-item__body { position: relative; z-index: 1; }
.work-item__title {
  font-size: clamp(1.7rem, 5vw, 3rem); font-weight: 800;
  margin-bottom: 10px;
}
.work-item__tagline {
  color: var(--lime); font-weight: 500;
  font-size: clamp(1rem, 2.6vw, 1.18rem);
  margin-bottom: 16px;
}
.work-item__desc { color: var(--text-dim); max-width: 480px; margin-bottom: 22px; }
.work-item__tags { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 24px; }
.work-item__tags span {
  padding: 6px 16px; border-radius: 999px;
  font-size: 0.82rem; color: var(--text-dim);
  border: 1px solid var(--surface-border);
  transition: border-color 0.3s, color 0.3s;
}
.work-item:hover .work-item__tags span { border-color: rgba(212, 255, 63, 0.4); color: var(--text); }
.work-item__links { display: flex; gap: 20px; }
.work-item__links a {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 0.95rem; color: var(--text);
  border-bottom: 1.5px solid var(--lime); padding-bottom: 3px;
  transition: color 0.3s;
}
.work-item__links a:hover { color: var(--lime); }
.work-item__links svg { width: 16px; height: 16px; }

@media (min-width: 920px) {
  .work-item { grid-template-columns: 1.05fr 1fr; }
  .work-item:nth-child(even) .work-item__media { order: 2; }
  .work-item__media { max-width: 520px; justify-self: center; width: 100%; }
}

/* ---------- about ---------- */
.about {
  display: grid; gap: clamp(36px, 6vw, 80px);
  align-items: center;
  background: var(--bg2);
  border-block: 1px solid var(--surface-border);
}
@media (min-width: 880px) { .about { grid-template-columns: 0.85fr 1.15fr; } }
.about__media { position: relative; }
.about__photo {
  aspect-ratio: 4 / 5; border-radius: var(--radius);
  background-size: cover; background-position: center;
  border: 1px solid var(--surface-border);
  filter: saturate(0.9) contrast(1.04);
}
.about__glow {
  position: absolute; inset: -8% -8% auto auto;
  width: 55%; aspect-ratio: 1; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(212, 255, 63, 0.16), transparent 70%);
  filter: blur(30px);
}
.about__bio {
  font-size: clamp(1.15rem, 3vw, 1.55rem);
  font-family: var(--font-display); font-weight: 500; line-height: 1.7;
  color: var(--text); margin: 22px 0 30px;
}
.about__skills { display: flex; flex-wrap: wrap; gap: 10px; }
.about__skills li {
  padding: 8px 20px; border-radius: 999px;
  font-size: 0.9rem; color: var(--text-dim);
  border: 1px solid var(--surface-border);
  background: var(--surface);
}

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact__inner { max-width: 760px; margin: 0 auto; }
.contact .section__head { margin-inline: auto; }
.contact .section__lead { margin-inline: auto; }

.contact__details {
  display: grid; gap: 14px; margin: 44px 0;
  text-align: start;
}
@media (min-width: 720px) { .contact__details { grid-template-columns: repeat(3, 1fr); } }
.contact__item {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  transition: border-color 0.3s, transform 0.3s var(--ease), background 0.3s;
}
a.contact__item:hover {
  border-color: rgba(212, 255, 63, 0.5);
  background: var(--lime-dim);
  transform: translateY(-4px);
}
.contact__ico { font-size: 1.4rem; }
.contact__txt { display: flex; flex-direction: column; line-height: 1.5; font-size: 0.92rem; color: var(--text-dim); }
.contact__txt b { color: var(--text); font-size: 0.95rem; font-weight: 600; }

.contact__form { display: grid; gap: 18px; text-align: start; }
.field { position: relative; }
.field input, .field textarea {
  width: 100%; padding: 17px 20px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: 16px; color: var(--text);
  font-family: inherit; font-size: 1rem;
  transition: border-color 0.3s, background 0.3s;
  resize: vertical;
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--lime);
  background: rgba(212, 255, 63, 0.04);
}
.field label {
  position: absolute; top: 17px; inset-inline-start: 20px;
  color: var(--text-dim); pointer-events: none;
  transition: transform 0.25s var(--ease), font-size 0.25s, color 0.25s, top 0.25s;
}
.field input:focus + label, .field textarea:focus + label,
.field input:not(:placeholder-shown) + label, .field textarea:not(:placeholder-shown) + label {
  top: -9px; font-size: 0.75rem; color: var(--lime);
  background: var(--bg); padding-inline: 8px; border-radius: 6px;
}
.contact__form .btn { justify-self: start; }
.contact__status { min-height: 1.4em; font-size: 0.92rem; }
.contact__status.ok { color: var(--lime); }
.contact__status.err { color: #ff5c7a; }

/* ---------- footer ---------- */
.footer {
  border-top: 1px solid var(--surface-border);
  padding: clamp(50px, 8vw, 80px) clamp(20px, 5vw, 56px) 36px;
  background: var(--bg2);
}
.footer__top {
  display: grid; gap: 36px;
  margin-bottom: 44px;
}
@media (min-width: 760px) { .footer__top { grid-template-columns: repeat(3, 1fr); } }
.footer__brand {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.7rem; margin-bottom: 10px;
}
.footer__brand span { color: var(--lime); }
.footer__line { color: var(--text-dim); font-size: 0.95rem; }
.footer__h {
  font-size: 1rem; font-weight: 700; margin-bottom: 14px; color: var(--text);
}
.footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; }
.footer__col a {
  color: var(--text-dim); font-size: 0.95rem;
  transition: color 0.3s;
}
.footer__col a:hover { color: var(--lime); }
.footer__socials {
  display: flex; gap: 14px; justify-content: center; margin-bottom: 26px;
}
.footer__socials a {
  display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--surface-border); color: var(--text-dim);
  transition: border-color 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.footer__socials a:hover { border-color: var(--lime); color: var(--lime); transform: translateY(-4px); }
.footer__socials svg { width: 20px; height: 20px; }
.footer__copy { text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* ---------- reveal (GSAP animates in) ---------- */
.js .reveal { opacity: 0; transform: translateY(34px); }
/* safety net: hero content always appears even if GSAP is blocked/slow */
.js .hero .reveal { animation: forceReveal 0.9s var(--ease) 2.4s forwards; }
@keyframes forceReveal { to { opacity: 1; transform: none; } }

/* ---------- legal pages ---------- */
.legal {
  max-width: 820px; margin: 0 auto;
  padding: 120px clamp(20px, 5vw, 40px) 80px;
}
.legal__back {
  display: inline-block; margin-bottom: 28px;
  color: var(--lime); font-size: 0.95rem;
}
.legal h1 {
  font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; margin-bottom: 10px;
}
.legal__updated { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 40px; }
.legal h2 {
  font-size: 1.25rem; font-weight: 700; margin: 36px 0 12px; color: var(--text);
}
.legal p, .legal li { color: var(--text-dim); line-height: 1.9; }
.legal ul { padding-inline-start: 22px; list-style: disc; margin: 10px 0; }
.legal a { color: var(--lime); }
.legal__contact {
  margin-top: 14px; padding: 22px 26px;
  background: var(--surface); border: 1px solid var(--surface-border);
  border-radius: 16px; line-height: 2; color: var(--text-dim);
}
.legal__contact strong { color: var(--text); }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .grain, .marquee__track, .hero__scroll span { animation: none; }
  html { scroll-behavior: auto; }
}
