/* Case Study Base Styles */

:root {
  --bg: #050505;
  --accent: #ff4500;
  --card: #111111;
  --ink: #d4ccc8;
  --mute: #9a8f8a;
  --line: rgba(255, 255, 255, 0.09);
  --ember: #3d0a06;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
}

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

html {
  scroll-behavior: smooth;
}

html[lang="ar"] .en {
  display: none !important;
}

html[lang="en"] .ar {
  display: none !important;
}

html[lang="ar"] body {
  font-family: "Inter", "IBM Plex Sans Arabic", sans-serif;
}

html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] .nav-logo {
  font-family: "Playfair Display", "Noto Serif Arabic", serif;
}

html[lang="ar"] * {
  letter-spacing: 0 !important;
}

html[lang="ar"] .sub {
  font-style: normal !important;
}

/* Hero glow: dark red glow from the CENTER -> jet black. Everything below stays #050505 */
body {
  background: #050505
    radial-gradient(
      ellipse min(900px, 150vw) 620px at 50% 250px,
      #5c0a0a 0%,
      #4a0808 18%,
      #350606 38%,
      #200404 58%,
      #0e0202 80%,
      #050505 100%
    )
    no-repeat top;
  color: var(--ink);
  font: 300 16px/1.75 var(--sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

header.hero {
  padding: 5vh 0 8vh;
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--mute);
  font-size: 14px;
  margin-bottom: 28px;
}

.meta span {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.meta span:not(:last-child)::after {
  content: "•";
  color: #5a4f4a;
}

.meta span.tag {
  color: #ffb59c;
}

.gradient-text {
  background: linear-gradient(90deg, #e5e7eb, var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(38px, 6.4vw, 76px);
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.sub {
  margin-top: 26px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.2vw, 24px);
  color: #d9c9c2;
  max-width: 34em;
  line-height: 1.5;
}

.sec {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 40px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}

.sec h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 24px;
  line-height: 1.25;
}

.sec p {
  max-width: 60ch;
  font-size: 17px;
  color: #d8d0cc;
}

.note {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  color: #ffb59c;
  border-left: 2px solid var(--accent);
  padding-left: 12px;
}

/* journey: open, no box */
.jr {
  padding-top: 6px;
}

.track {
  margin: 0 0 64px;
}

.track:last-child {
  margin-bottom: 0;
}

.tl {
  display: block;
  font-size: 14px;
  color: var(--mute);
  margin-bottom: 22px;
}

.after .tl {
  color: #ffb59c;
}

.track ol {
  list-style: none;
  padding: 0;
  display: flex;
}

.track li {
  flex: 1;
  position: relative;
  padding: 30px 14px 0 0;
  font-family: var(--serif);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.3;
  color: #8d827d;
}

.track li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid #6b605b;
  background: var(--bg);
}

.track li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 24px;
  right: 12px;
  height: 1px;
  border-top: 1px dashed #5a4f4a;
}

.bw {
  width: var(--w);
}

.after li {
  color: var(--ink);
}

.after li::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow:
    0 0 0 5px rgba(255, 69, 0, 0.16),
    0 0 24px rgba(255, 69, 0, 0.55);
}

.after li:last-child {
  font-weight: 600;
}

.after li:last-child::before {
  width: 19px;
  height: 19px;
  top: -3px;
  box-shadow:
    0 0 0 7px rgba(255, 69, 0, 0.2),
    0 0 38px rgba(255, 69, 0, 0.8);
}

.after li:not(:last-child)::after {
  border-top: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), rgba(255, 69, 0, 0.25));
  transform-origin: left;
  animation: draw 0.7s ease both;
  animation-delay: calc(0.25s + var(--i) * 0.28s);
}

.after li::before {
  animation: pop 0.4s ease both;
  animation-delay: calc(var(--i) * 0.28s);
}

@keyframes drawy {
  from {
    transform: scaleY(0);
  }

  to {
    transform: scaleY(1);
  }
}

@keyframes draw {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@keyframes pop {
  from {
    transform: scale(0);
  }

  to {
    transform: scale(1);
  }
}

/* device frames */
.after ol {
  position: relative;
}

/* takeaway */
.take {
  padding: 90px 0;
  border-top: 1px solid var(--line);
  text-align: start;
}

.take p {
  font-family: var(--serif);
  font-size: clamp(26px, 4vw, 46px);
  line-height: 1.2;
  max-width: 20em;
  font-weight: 500;
  letter-spacing: -0.01em;
}

@media (max-width: 760px) {
  .sec {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 36px 0;
  }

  .bw {
    width: 100%;
  }

  .track ol {
    flex-direction: column;
  }

  .track li {
    padding: 0 0 26px 34px;
  }

  .track li:not(:last-child)::after {
    top: 20px;
    bottom: 6px;
    left: 6px;
    right: auto;
    width: 1px;
    height: auto !important;
    border-top: 0;
    border-left: 1px dashed #5a4f4a;
    background: none;
  }

  .after li:not(:last-child)::after {
    width: 2px;
    background: linear-gradient(180deg, var(--accent), rgba(255, 69, 0, 0.25));
    border: 0;
    transform-origin: top;
    animation-name: drawy;
  }

  .after li:last-child::before {
    left: -3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .in {
    animation: none;
  }

  html {
    scroll-behavior: auto;
  }
}

.wrap {
  padding-top: 64px;
}

header.hero {
  display: block;
  max-width: 820px;
  padding: 6vh 0 8vh;
}

.take {
  padding-bottom: 110px;
}

/* Navigation */
.nav-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  padding: 32px 24px;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.9) 0%, transparent 100%);
  pointer-events: none;
}

.nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

.nav-logo {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: -0.05em;
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 14px;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #e5e7eb;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 500;
  background: #e5e7eb;
  color: #000;
  text-decoration: none;
  transition: all 0.3s;
}

.nav-cta:hover {
  transform: scale(1.05);
  background: #f3f4f6;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.lang-toggle {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  transition: color 0.3s;
}

.lang-toggle:hover {
  color: #e5e7eb;
}

@media (max-width: 760px) {
  .nav-links {
    display: none;
  }

  .logo-text {
    display: none;
  }

  .wrap {
    padding-top: 120px;
  }
}

/* Image Layout & Lightbox */
.img-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  margin-top: 32px;
  width: 100%;
}

.img-col img {
  width: 100%;
  max-width: 800px;
  border-radius: 12px;
  cursor: zoom-in;
  transition: transform 0.2s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.img-col img:hover {
  transform: scale(1.02);
}

#lightbox {
  display: none;
  position: fixed;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}

#lightbox.active {
  display: flex;
  opacity: 1;
}

#lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  object-fit: contain;
  cursor: zoom-out;
}

/* Animations */
.mask-text {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}

.mask-text .mask-inner {
  display: inline-block;
  transform: translateY(100%);
  transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.mask-text.is-visible .mask-inner {
  transform: translateY(0);
}

.fade-in-text {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

.fade-in-text.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Utilities */
.flex-center-8 {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.img-md {
  max-width: 400px !important;
}

.img-lg {
  max-width: 600px !important;
}
