/* ============================================================
   Yaseen Farag — main.css
   Warm editorial palette, bold typography, considered spacing.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:          #0D0B08;   /* warm near-black */
  --bg-elev:     #15120D;
  --bg-line:     #1D1914;
  --bg-deep:     #080705;

  /* Text */
  --fg:          #F2E8D8;   /* warm cream */
  --fg-mute:     #9D9384;
  --fg-dim:      #544A3D;

  /* Accents — three-color signature */
  --c1:          #FF5B2E;   /* coral — primary CTAs, highlights */
  --c2:          #DDFF4A;   /* electric lime — secondary / dots / hovers */
  --c3:          #8B71FF;   /* violet — decorative gradients */

  /* Compatibility aliases (kept so nothing breaks) */
  --accent:      var(--c1);
  --accent-2:    var(--c2);
  --accent-3:    var(--c3);
  --accent-warm: var(--c1);

  /* Hairlines */
  --hair:        rgba(242, 232, 216, 0.08);
  --hair-strong: rgba(242, 232, 216, 0.22);

  /* Radii / shape */
  --radius:      16px;
  --radius-lg:   24px;

  /* Typography */
  --f-display:   "Inter", "Inter Placeholder", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Easing */
  --ease:        cubic-bezier(.2, .7, .2, 1);
  --ease-out:    cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.83, 0, .17, 1);

  /* Layout */
  --max:         1520px;
  --pad-x:       clamp(20px, 4vw, 72px);
  --pad-y:       clamp(96px, 14vw, 200px);

  --nav-h:       76px;

  color-scheme: dark;
}

/* -------- Reset -------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;
  overflow-x: hidden;
}
body {
  min-height: 100svh;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-display);
  font-size: clamp(15px, 0.95vw + 0.5rem, 17px);
  line-height: 1.55;
  letter-spacing: -0.01em;
  font-feature-settings: "ss01", "cv11";
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }

::selection { background: var(--c2); color: #141206; }

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

/* -------- Typography -------- */
.mono { font-family: var(--f-mono); font-weight: 400; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.72em; }

.section__kicker {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--c1);
  margin-bottom: 32px;
  font-size: 12px;
  letter-spacing: 0.12em;
}
.section__kicker::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 1px;
  background: var(--c1);
  animation: draw-line 1.1s var(--ease-out) forwards;
  animation-play-state: paused;
}
.is-in-view .section__kicker::before { animation-play-state: running; }
.section__kicker i { font-style: normal; color: var(--fg-mute); }

.section__title {
  font-size: clamp(2.4rem, 5vw, 5.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.038em;
  max-width: 22ch;
}

/* -------- Layout -------- */
main { display: block; }
section {
  padding-inline: var(--pad-x);
  padding-block: var(--pad-y);
  max-width: var(--max);
  margin-inline: auto;
  position: relative;
}

/* Scroll progress bar */
.scroll-progress {
  position: fixed; top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform-origin: left;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3));
  z-index: 70;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* -------- Nav -------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-h);
  z-index: 50;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 32px;
  padding-inline: var(--pad-x);
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--hair);
  transition: transform .5s var(--ease), background .3s var(--ease);
}
.nav.is-hidden { transform: translateY(-110%); }

.nav__links { justify-self: center; display: flex; gap: 4px; }
.nav__links a {
  position: relative;
  padding: 10px 18px;
  font-size: 13px;
  color: var(--fg-mute);
  letter-spacing: -0.005em;
  transition: color .3s var(--ease);
  white-space: nowrap;
}
.nav__links a::after {
  content: "";
  position: absolute; left: 18px; right: 18px; bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .5s var(--ease-out);
}
.nav__links a:hover { color: var(--fg); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a.is-current { color: var(--c2); }
.nav__links a.is-current::after { transform: scaleX(1); background: var(--c2); }

/* -------- Hero -------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + clamp(40px, 8vw, 100px));
  padding-inline: var(--pad-x);
  padding-bottom: clamp(80px, 12vw, 140px);
  max-width: var(--max);
  margin-inline: auto;
  display: grid;
  align-content: end;
  isolation: isolate;
  overflow: visible;
}
.hero__canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.2s var(--ease-out);
}
.hero__canvas.is-ready { opacity: 1; }

.hero__meta {
  position: absolute;
  top: calc(var(--nav-h) + 24px);
  right: var(--pad-x);
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  color: var(--fg-mute);
}
.hero__meta span { font-size: 11px; }

.hero__inner {
  max-width: 1100px;
  width: 100%;
}

.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--fg-mute);
  margin-bottom: clamp(28px, 3vw, 44px);
  padding: 8px 16px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  background: color-mix(in oklab, var(--fg) 3%, transparent);
  font-size: 12px;
}

.hero__title {
  font-size: clamp(2.6rem, 9vw, 9.2rem);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.052em;
  max-width: 14ch;
  padding-bottom: 0.08em;
}
.hero__title .line {
  display: block;
  overflow: clip;
  padding-block: 0.02em 0.1em;
  margin-top: -0.02em;
}
.hero__title em {
  font-style: normal;
  color: var(--c1);
  font-family: "Instrument Serif", "Times New Roman", serif;
  letter-spacing: -0.02em;
}

.hero__sub {
  margin-top: clamp(28px, 3.5vw, 48px);
  max-width: 58ch;
  color: var(--fg-mute);
  font-size: clamp(1rem, 1.25vw, 1.15rem);
  line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.hero__sub-prompt { color: var(--c2); padding-top: 3px; font-size: 14px; }
.hero__sub-type { white-space: pre-wrap; }
.hero__sub-caret {
  display: inline-block;
  width: 0.55ch; height: 1.1em;
  background: var(--c2);
  margin-left: 2px;
  translate: 0 0.2em;
  animation: blink 1s steps(2, start) infinite;
}

.hero__actions {
  margin-top: clamp(40px, 5vw, 64px);
  display: flex; flex-wrap: wrap; gap: 16px;
}

.hero__scroll {
  position: absolute;
  bottom: 32px;
  left: var(--pad-x);
  display: inline-flex; flex-direction: column; align-items: center; gap: 12px;
  color: var(--fg-mute);
}
.hero__scroll span { font-size: 10px; }
.hero__scroll-line {
  display: block; width: 1px; height: 56px;
  background: linear-gradient(to bottom, var(--c2), transparent);
  animation: scrollCue 2.4s var(--ease) infinite;
  transform-origin: top;
}

/* -------- About -------- */
.about {
  display: grid;
  grid-template-columns: 0.9fr 1.5fr;
  gap: clamp(40px, 6vw, 120px);
  align-items: start;
  border-top: 1px solid var(--hair);
}
.about__col--sticky {
  position: sticky;
  top: calc(var(--nav-h) + 40px);
  align-self: start;
}
.about__lede {
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.38;
  color: var(--fg);
  letter-spacing: -0.018em;
  max-width: 40ch;
  margin-bottom: 48px;
  font-weight: 400;
}
.about__lede em {
  font-style: normal;
  color: var(--c1);
  font-family: "Instrument Serif", "Times New Roman", serif;
  letter-spacing: -0.02em;
}
.about__body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--fg-mute);
  max-width: 52ch;
  margin-bottom: 72px;
}
.about__chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.about__chips li {
  padding: 10px 18px;
  border: 1px solid var(--hair-strong);
  border-radius: 999px;
  font-size: 13px;
  color: var(--fg-mute);
  background: color-mix(in oklab, var(--fg) 2%, transparent);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
  white-space: nowrap;
}
.about__chips li:hover {
  color: var(--c2);
  border-color: var(--c2);
  transform: translateY(-2px);
  background: color-mix(in oklab, var(--c2) 8%, transparent);
}

/* -------- Services -------- */
.services { border-top: 1px solid var(--hair); }
.services__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(24px, 4vw, 80px);
  align-items: end;
  margin-bottom: clamp(56px, 8vw, 104px);
}
.services__head .btn { align-self: end; }

.services__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* -------- Work / Timeline -------- */
.work { border-top: 1px solid var(--hair); }
.work__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(24px, 4vw, 80px);
  align-items: end;
  margin-bottom: clamp(56px, 8vw, 104px);
}

.timeline {
  position: relative;
  padding-block: 60px;
}
.timeline__rail {
  position: absolute;
  top: 0; bottom: 0; left: 50%;
  width: 1px;
  background: var(--hair);
  transform: translateX(-50%);
}
.timeline__fill {
  position: absolute; top: 0; left: 0;
  width: 100%;
  background: linear-gradient(to bottom, var(--c1), var(--c3));
  height: 0%;
  transition: height .1s linear;
}
.timeline__item {
  position: relative;
  width: calc(50% - 48px);
  padding: 24px 0;
  margin-block: 48px;
}
.timeline__item[data-side="left"] {
  margin-right: auto;
  padding-right: 32px;
  text-align: right;
}
.timeline__item[data-side="right"] {
  margin-left: auto;
  padding-left: 32px;
}
.timeline__dot {
  position: absolute;
  top: 32px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--hair-strong);
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.timeline__item[data-side="left"] .timeline__dot { right: -54px; }
.timeline__item[data-side="right"] .timeline__dot { left: -54px; }
.timeline__item.is-active .timeline__dot {
  background: var(--c2);
  border-color: var(--c2);
  box-shadow: 0 0 0 6px color-mix(in oklab, var(--c2) 18%, transparent);
}
.timeline__meta { color: var(--c1); margin-bottom: 16px; display: block; font-size: 11px; letter-spacing: 0.12em; }
.timeline__title {
  font-size: clamp(1.3rem, 2.2vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 18px;
}
.timeline__body {
  display: flex; flex-direction: column; gap: 10px;
  color: var(--fg-mute);
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 44ch;
}
.timeline__item[data-side="left"] .timeline__body { margin-left: auto; }

/* -------- Stats -------- */
.stats {
  border-top: 1px solid var(--hair);
  overflow: hidden;
}
.stats__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 96px;
}
.stat {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding-block: 28px;
  border-top: 1px solid var(--hair);
  position: relative;
}
.stat__num {
  font-size: clamp(3.2rem, 6.5vw, 6rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat__unit { font-style: normal; color: var(--c1); font-size: clamp(1.6rem, 2.4vw, 2.2rem); }
.stat__label { width: 100%; color: var(--fg-mute); font-size: 11px; margin-top: 10px; letter-spacing: 0.1em; }

.stats__ticker {
  overflow: hidden;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding-block: 16px;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.stats__ticker-track {
  display: inline-flex; gap: 40px;
  white-space: nowrap;
  animation: ticker 40s linear infinite;
  color: var(--fg-mute);
  font-family: var(--f-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.stats__ticker-track span:nth-child(3n) { color: var(--c1); }

/* -------- Marquee (tech) -------- */
.marquee {
  padding-block: 48px;
  overflow: hidden;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.marquee__track {
  display: flex; gap: 0;
  width: max-content;
  animation: marquee 50s linear infinite;
}
.marquee__track:hover { animation-play-state: paused; }
.marquee__track ul {
  display: flex; gap: 48px; padding-right: 48px; align-items: center;
  font-size: clamp(1.6rem, 3.2vw, 2.8rem);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--fg-dim);
}
.marquee__track li { transition: color .3s var(--ease); }
.marquee__track li:hover { color: var(--c1); }
.marquee__track li:nth-child(6n+1):hover { color: var(--c2); }
.marquee__track li:nth-child(6n+3):hover { color: var(--c3); }

/* -------- Contact -------- */
.contact {
  border-top: 1px solid var(--hair);
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(40px, 6vw, 120px);
  align-items: start;
}
.contact__head { position: sticky; top: calc(var(--nav-h) + 40px); }
.contact__title {
  font-size: clamp(3rem, 8vw, 8rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.052em;
  margin-block: 16px 32px;
  max-width: 10ch;
  padding-bottom: 0.05em;
}
.contact__title em {
  font-style: normal;
  color: var(--c1);
  font-family: "Instrument Serif", "Times New Roman", serif;
}
.contact__lede { color: var(--fg-mute); max-width: 44ch; font-size: 1.05rem; line-height: 1.6; }

/* -------- Footer -------- */
.foot {
  position: relative;
  padding: clamp(96px, 10vw, 160px) var(--pad-x) 40px;
  border-top: 1px solid var(--hair);
  overflow: hidden;
}
.foot__ghost {
  position: absolute;
  left: var(--pad-x);
  right: var(--pad-x);
  bottom: 32px;
  font-size: clamp(6rem, 24vw, 22rem);
  line-height: 0.84;
  font-weight: 600;
  letter-spacing: -0.07em;
  color: color-mix(in oklab, var(--fg) 4%, transparent);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
  z-index: 0;
}
.foot__ghost-accent { color: color-mix(in oklab, var(--c1) 14%, transparent); }
.foot__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: clamp(120px, 18vw, 260px);
}
.foot__motto {
  font-size: clamp(1.2rem, 1.8vw, 1.6rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.02em;
  max-width: 26ch;
}
.foot__motto em {
  font-style: normal;
  color: var(--c1);
  font-family: "Instrument Serif", "Times New Roman", serif;
}
.foot__label { color: var(--fg-mute); margin-bottom: 16px; letter-spacing: 0.12em; }
.foot__links { display: flex; flex-direction: column; gap: 10px; }
.foot__links a {
  position: relative;
  color: var(--fg);
  transition: color .3s var(--ease), padding-left .3s var(--ease);
}
.foot__links a::before {
  content: "→";
  position: absolute;
  left: -14px; top: 0;
  opacity: 0;
  color: var(--c2);
  transition: opacity .3s var(--ease), left .3s var(--ease);
}
.foot__links a:hover { color: var(--c2); padding-left: 18px; }
.foot__links a:hover::before { opacity: 1; left: 0; }
.foot__status { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); }
.foot__bottom {
  position: relative;
  z-index: 1;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--hair);
  color: var(--fg-mute);
  font-size: 11px;
}

/* -------- Responsive -------- */
@media (max-width: 1024px) {
  .services__grid { grid-template-columns: 1fr 1fr; }
  .stats__row { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr; }
  .contact__head { position: static; }
  .foot__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  :root { --pad-y: clamp(72px, 16vw, 128px); }
  .nav { grid-template-columns: auto 1fr auto; gap: 14px; }
  .nav__links { display: none; }
  .hero__meta { display: none; }
  .hero__inner { max-width: 100%; }
  .about { grid-template-columns: 1fr; }
  .about__col--sticky { position: static; }
  .services__head, .work__head { grid-template-columns: 1fr; gap: 16px; align-items: start; }
  .services__head .btn { align-self: start; justify-self: start; }
  .services__grid { grid-template-columns: 1fr; }
  .stats__row { grid-template-columns: 1fr 1fr; }
  .timeline__rail { left: 12px; }
  .timeline__item { width: 100%; padding-left: 40px !important; padding-right: 0 !important; text-align: left !important; margin-left: 0 !important; }
  .timeline__item .timeline__dot { left: 6px !important; right: auto !important; }
  .timeline__item[data-side="left"] .timeline__body { margin-left: 0; }
  .foot__grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .hero__canvas, .stats__ticker-track, .marquee__track { animation: none !important; }
}
