/* Loops Technologies - design system
   Poppins, light weights, small type, square corners, flat surfaces. */

:root {
  --brand: #ea580c;
  --brand-dark: #c2410c;
  --ink: #171717;
  --text: #4b4b4b;
  --muted: #7d7d7d;
  --line: #e3e3e0;
  --bg: #ffffff;
  --bg-alt: #f6f6f4;
  --dark: #141414;
  --dark-line: #2a2a2a;
  --header-h: 64px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Poppins', 'Noto Sans Arabic', sans-serif;
  font-size: 14px;
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[lang='ar'] body {
  font-family: 'Noto Sans Arabic', 'Poppins', sans-serif;
  line-height: 1.9;
}

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  color: var(--ink);
  font-weight: 400;
  line-height: 1.25;
  font-style: normal;
}

p {
  margin: 0;
}

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

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

::selection {
  background: var(--brand);
  color: #fff;
}

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

/* ---------- Layout ---------- */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-dark {
  background: var(--dark);
  color: #a8a8a8;
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: #fff;
}

.page-head {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Typography ---------- */

.eyebrow {
  display: inline-block;
  color: var(--brand);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

html[dir='rtl'] .eyebrow {
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
}

.display {
  font-size: clamp(1.9rem, 3.4vw, 2.75rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.display .accent,
.heading .accent {
  color: var(--brand);
}

.heading {
  font-size: clamp(1.375rem, 2.2vw, 1.75rem);
  font-weight: 300;
  letter-spacing: -0.01em;
}

.lead {
  max-width: 560px;
  color: var(--text);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.8;
}

.meta {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

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

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.btn-outline:hover {
  background: var(--ink);
  color: #fff;
}

.btn-light {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

.btn-light:hover {
  background: transparent;
  color: #fff;
}

.btn-sm {
  padding: 9px 16px;
  font-size: 12px;
}

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 400;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.link-arrow:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.link-arrow i {
  font-size: 10px;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  z-index: 50;
  width: 100%;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-link {
  position: relative;
  padding: 6px 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 1px;
  background: var(--brand);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--ink);
}

.nav-link.active::after,
.nav-link:hover::after {
  transform: scaleX(1);
}

.lang-switch {
  display: flex;
  border: 1px solid var(--line);
}

.lang-btn {
  padding: 5px 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: 'Poppins', sans-serif;
  font-size: 11px;
  font-weight: 400;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.lang-btn + .lang-btn {
  border-inline-start: 1px solid var(--line);
}

.lang-btn:hover {
  color: var(--ink);
}

.lang-btn.is-active {
  background: var(--ink);
  color: #fff;
}

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  flex-direction: column;
  padding: 0 24px 32px;
  background: #fff;
}

.mobile-menu.is-open {
  display: flex;
}

.mobile-menu a {
  display: block;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
  font-weight: 300;
}

/* ---------- Hero ---------- */

.hero {
  padding: 72px 0 80px;
}

.hero-grid {
  display: grid;
  align-items: center;
  gap: 64px;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero-media {
  position: relative;
}

.hero-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
}

.hero-caption {
  display: flex;
  gap: 24px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}

.hero-caption i {
  margin-inline-end: 8px;
  color: var(--brand);
}

/* ---------- Stats strip ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.stat {
  padding: 28px 24px;
  border-inline-end: 1px solid var(--line);
}

.stat:last-child {
  border-inline-end: 0;
}

.stat-value {
  color: var(--ink);
  font-size: 24px;
  font-weight: 300;
  letter-spacing: -0.01em;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
}

/* ---------- Cell grids (shared borders) ---------- */

.cells {
  display: grid;
  border-top: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
  background: var(--bg);
}

.cells > * {
  border-inline-end: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 640px) {
  .cells-2,
  .cells-3,
  .cells-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cells-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .cells-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cell {
  display: flex;
  flex-direction: column;
  padding: 32px;
  transition: background-color 0.2s ease;
}

a.cell:hover,
.cell.is-link:hover {
  background: var(--bg-alt);
}

.cell-icon {
  margin-bottom: 24px;
  color: var(--brand);
  font-size: 20px;
}

.cell-title {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 400;
}

.cell-text {
  margin-bottom: 24px;
  font-size: 13.5px;
  line-height: 1.7;
}

.cell .link-arrow {
  align-self: flex-start;
  margin-top: auto;
}

.cell-num {
  margin-bottom: 24px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.section-dark .cells,
.section-dark .cells > * {
  border-color: var(--dark-line);
  background: transparent;
}

.section-dark .cell-title {
  color: #fff;
}

/* ---------- Section header ---------- */

.section-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 40px;
}

@media (min-width: 768px) {
  .section-head.split {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }
}

.section-head .heading {
  margin-top: 8px;
}

/* ---------- Projects ---------- */

.project-card {
  display: block;
}

.project-media {
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.project-card:hover .project-media img {
  transform: scale(1.03);
}

.project-body {
  padding: 20px 0 0;
}

.project-body h3 {
  margin: 4px 0 8px;
  font-size: 18px;
  font-weight: 400;
}

.project-card:hover h3 {
  color: var(--brand);
}

/* ---------- Tags ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  font-size: 12px;
}

.tag i {
  color: var(--muted);
}

/* ---------- Detail page ---------- */

.detail-grid {
  display: grid;
  gap: 56px;
}

@media (min-width: 1024px) {
  .detail-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 72px;
  }
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.crumbs a:hover {
  color: var(--brand);
}

.prose-body p {
  margin-bottom: 18px;
  font-size: 15px;
  line-height: 1.85;
}

.check-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--dark-line);
  color: #e6e6e6;
  font-size: 15px;
}

.check-list i {
  margin-top: 5px;
  color: var(--brand);
  font-size: 12px;
}

.side-box {
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--bg-alt);
}

@media (min-width: 1024px) {
  .side-box.sticky {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
}

.side-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  transition: color 0.2s ease;
}

.side-link:last-child {
  border-bottom: 0;
}

.side-link i {
  width: 18px;
  color: var(--brand);
  text-align: center;
}

.side-link:hover {
  color: var(--brand);
}

/* ---------- Forms ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 400;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #cfcfcb;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  transition: border-color 0.2s ease;
  appearance: none;
}

.input::placeholder {
  color: #a3a3a3;
}

.input:focus {
  border-color: var(--ink);
  outline: none;
}

select.input {
  padding-inline-end: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23171717' stroke-width='1.2'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

html[dir='rtl'] select.input {
  background-position: left 14px center;
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--dark);
  color: #9a9a9a;
}

.site-footer h4 {
  margin-bottom: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

html[dir='rtl'] .site-footer h4 {
  letter-spacing: 0;
  text-transform: none;
}

.site-footer a {
  transition: color 0.2s ease;
}

.site-footer a:hover {
  color: #fff;
}

.social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--dark-line);
  color: #cfcfcf;
  font-size: 13px;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.social:hover {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff !important;
}

/* ---------- Motion ---------- */

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

#app {
  transition: opacity 0.15s ease;
}

#app.is-leaving {
  opacity: 0;
}

[dir='rtl'] .fa-arrow-right,
[dir='rtl'] .fa-chevron-right {
  transform: scaleX(-1);
}

[dir='rtl'] .fa-chevron-left {
  transform: scaleX(-1);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}
