/* ============================================================
   Superwomen — professional refinement layer
   Loaded after site.css. Owns: global typography upgrade +
   a from-scratch, mobile-first redesign of the home page.
   ============================================================ */

:root {
  --font-ar: "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-latin: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-brand: "Poppins", var(--font-latin);

  /* Re-point the site-wide display tokens at the professional family */
  --display-ar: var(--font-ar);
  --display-latin: var(--font-latin);

  --hp-radius: 22px;
  --hp-radius-sm: 14px;
  --hp-radius-pill: 999px;
  --hp-border: 1px solid rgba(29, 80, 71, 0.10);
  --hp-shadow: 0 14px 38px rgba(15, 32, 39, 0.08);
  --hp-shadow-sm: 0 8px 22px rgba(15, 32, 39, 0.06);
  --hp-gap: clamp(2.4rem, 5vw, 4rem);
}

/* ---------- Global professional typography ---------- */
body {
  font-family: var(--font-ar);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: 0;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-ar);
  font-weight: 700;
  letter-spacing: 0;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

.brand {
  font-family: var(--font-brand);
}

/* ============================================================
   HOME PAGE
   ============================================================ */
.page-home {
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(159, 78, 168, 0.10), transparent 60%),
    radial-gradient(50rem 36rem at 0% 0%, rgba(249, 129, 73, 0.07), transparent 55%),
    linear-gradient(180deg, #fffdfb 0%, var(--bg) 100%);
}

.hp {
  position: relative;
  isolation: isolate;
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.hp-stack {
  display: grid;
  gap: var(--hp-gap);
  margin-top: var(--hp-gap);
}

.hp-stack > * {
  min-width: 0;
}

.hp-section {
  min-width: 0;
  scroll-margin-top: 6rem;
}

/* ---------- Shared section header ---------- */
.hp-section__head {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin: 0 0 clamp(1.1rem, 2.4vw, 1.7rem);
}

.hp-section__heading {
  display: grid;
  gap: 0.6rem;
}

.hp-section__heading h2 {
  margin: 0;
  max-width: none;
  color: var(--green-deep);
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.25;
}

.hp-eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--hp-radius-pill);
  background: rgba(159, 78, 168, 0.10);
  color: var(--purple-deep);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  width: max-content;
}

/* ---------- Hero ---------- */
.hp-hero {
  position: relative;
  overflow: hidden;
  margin: clamp(0.75rem, 2vw, 1.5rem) auto 0;
  width: var(--shell);
  border-radius: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 245, 249, 0.30)),
    linear-gradient(135deg, rgba(29, 80, 71, 0.08), rgba(159, 78, 168, 0.12) 55%, rgba(251, 162, 3, 0.10)),
    var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--hp-shadow);
}

.hp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--identity-pattern-soft) center / 30rem auto repeat;
  opacity: 0.16;
  z-index: 0;
}

.hp-hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.6rem, 4vw, 3.6rem);
}

.hp-hero__copy {
  display: grid;
  gap: clamp(0.7rem, 1.6vw, 1.05rem);
  text-align: right;
  min-width: 0;
}

.hp-hero__title {
  margin: 0;
  font-family: var(--font-brand);
  font-weight: 700;
  color: var(--green-deep);
  font-size: clamp(2.3rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.hp-hero__tagline {
  margin: 0;
  color: var(--purple-deep);
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 600;
  line-height: 1.5;
}

.hp-hero__lead {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.2vw, 1.05rem);
  line-height: 1.85;
  max-width: 34rem;
}

.hp-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.4rem;
}

.hp-hero__media {
  position: relative;
  margin: 0;
  border-radius: clamp(18px, 2.4vw, 26px);
  overflow: hidden;
  aspect-ratio: 4 / 5;
  max-height: 30rem;
  justify-self: end;
  width: 100%;
  background: linear-gradient(160deg, rgba(159, 78, 168, 0.12), rgba(255, 245, 249, 0.5));
  box-shadow: 0 18px 44px rgba(15, 32, 39, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.hp-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

/* ---------- Horizontal rails ---------- */
.hp-rail {
  display: grid;
  grid-auto-flow: column;
  gap: clamp(0.85rem, 1.6vw, 1.15rem);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 0.1rem;
  padding: 0.3rem 0.1rem 1rem;
  margin: 0;
  min-width: 0;
  max-width: 100%;
  scrollbar-width: none;
  direction: rtl;
}

.hp-rail::-webkit-scrollbar {
  display: none;
}

.hp-rail__item {
  scroll-snap-align: start;
}

.hp-rail--news {
  grid-auto-columns: minmax(17rem, 20rem);
}

.hp-rail--projects {
  grid-auto-columns: minmax(17rem, 20rem);
}

/* News card inside the rail */
.hp-rail--news .news-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 11rem 1fr;
  height: 100%;
  min-height: 21rem;
  border-radius: var(--hp-radius);
  border: var(--hp-border);
  background: var(--surface);
  box-shadow: var(--hp-shadow-sm);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.hp-rail--news .news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow);
}

.hp-rail--news .news-card__media {
  aspect-ratio: auto;
  height: 100%;
  min-height: 0;
  background: var(--paper);
}

.hp-rail--news .news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 0;
}

.hp-rail--news .news-card--textual {
  grid-template-rows: 1fr;
}

.hp-rail--news .news-card__body {
  display: grid;
  align-content: start;
  gap: 0.55rem;
  padding: 1.05rem 1.15rem 1.2rem;
}

.hp-rail--news .news-card__meta {
  gap: 0.6rem;
  color: var(--purple-deep);
  font-size: 0.76rem;
  font-weight: 600;
}

.hp-rail--news .news-card h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--green-deep);
  font-size: 1.02rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hp-rail--news .news-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.hp-rail--news .news-card .text-link {
  margin-top: 0.15rem;
  color: var(--green);
  font-weight: 600;
  font-size: 0.84rem;
}

/* ---------- Stats grid (no horizontal scroll) ---------- */
.hp-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.7rem, 1.6vw, 1.1rem);
}

.hp-stat {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.5rem;
  padding: clamp(1.1rem, 2.4vw, 1.6rem) 1rem;
  text-align: center;
  border-radius: var(--hp-radius);
  border: var(--hp-border);
  background: var(--surface);
  box-shadow: var(--hp-shadow-sm);
}

.hp-stat__icon {
  /* The glyph pseudo-elements are geometrically tuned for a 3.7rem
     circle — keep this size so the icons render correctly. */
  width: 3.7rem;
  height: 3.7rem;
  background: rgba(29, 80, 71, 0.06);
  border-color: rgba(29, 80, 71, 0.14);
}

.hp-stat__value {
  color: var(--gold);
  font-family: var(--font-latin);
  font-weight: 700;
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.hp-stat__label {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.8rem, 1.2vw, 0.92rem);
  line-height: 1.5;
}

/* ---------- Promo cards ---------- */
.hp-promo {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: stretch;
  gap: clamp(1.2rem, 3vw, 2.4rem);
  padding: clamp(1.3rem, 3vw, 2.4rem);
  border-radius: var(--hp-radius);
  border: var(--hp-border);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 250, 247, 0.9)),
    var(--surface);
  box-shadow: var(--hp-shadow);
}

.hp-promo--game {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 244, 239, 0.92)),
    linear-gradient(135deg, rgba(251, 162, 3, 0.06), rgba(249, 129, 73, 0.08)),
    var(--surface);
}

.hp-promo__copy {
  display: grid;
  align-content: center;
  gap: 0.8rem;
}

.hp-promo__copy h2 {
  margin: 0;
  color: var(--green-deep);
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  line-height: 1.3;
}

.hp-promo__copy p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.92rem, 1.2vw, 1.02rem);
  line-height: 1.85;
}

.hp-promo__copy .button {
  justify-self: start;
  margin-top: 0.3rem;
}

.hp-promo__media {
  margin: 0;
  border-radius: var(--hp-radius-sm);
  overflow: hidden;
  background: var(--paper);
  min-height: 14rem;
}

.hp-promo__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
}

/* ---------- Project cards ---------- */
.hp-project {
  display: grid;
  grid-template-rows: 9.5rem 1fr;
  overflow: hidden;
  border-radius: var(--hp-radius);
  border: var(--hp-border);
  background: var(--surface);
  box-shadow: var(--hp-shadow-sm);
  border-inline-start: 4px solid var(--project-accent, var(--green));
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.hp-project:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow);
}

.hp-project__media {
  margin: 0;
  overflow: hidden;
  background: var(--paper-strong);
}

.hp-project__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hp-project__body {
  display: grid;
  gap: 0.45rem;
  align-content: start;
  padding: 1rem 1.1rem 1.2rem;
}

.hp-project__eyebrow {
  color: var(--purple-deep);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hp-project__title {
  display: -webkit-box;
  overflow: hidden;
  color: var(--green-deep);
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hp-project__summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 960px) {
  .hp-hero__inner {
    grid-template-columns: 1fr;
    gap: clamp(1.4rem, 4vw, 2.2rem);
  }

  .hp-hero__media {
    order: -1;
    aspect-ratio: 5 / 4;
    max-height: 24rem;
    justify-self: stretch;
  }

  .hp-hero__media img {
    object-position: center 32%;
  }

  .hp-promo {
    grid-template-columns: 1fr;
  }

  .hp-promo__media {
    order: -1;
    min-height: 0;
    aspect-ratio: 5 / 3;
  }

  .hp-promo__media img {
    object-position: center 30%;
  }
}

/* Phone */
@media (max-width: 640px) {
  .hp-stack {
    gap: clamp(2rem, 8vw, 2.8rem);
    margin-top: clamp(1.8rem, 7vw, 2.6rem);
  }

  .hp-hero {
    width: calc(100% - 1.6rem);
    border-radius: 20px;
  }

  .hp-hero__inner {
    padding: 1.1rem 1.1rem 1.4rem;
  }

  .hp-hero__media {
    aspect-ratio: 4 / 3;
    max-height: 17rem;
  }

  .hp-hero__copy {
    gap: 0.7rem;
  }

  .hp-hero__title {
    font-size: clamp(2rem, 9vw, 2.6rem);
  }

  .hp-hero__lead {
    font-size: 0.92rem;
    line-height: 1.75;
  }

  .hp-hero__actions {
    gap: 0.55rem;
  }

  .hp-hero__actions .button {
    flex: 1 1 auto;
  }

  .hp-section__head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .hp-section__head .rail-controls {
    display: none;
  }

  .hp-section__heading {
    gap: 0.5rem;
  }

  .hp-section__heading h2 {
    font-size: clamp(1.35rem, 6vw, 1.7rem);
  }

  /* Rails: comfortable single-card-with-peek */
  .hp-rail {
    scroll-snap-type: x mandatory;
    gap: 0.8rem;
  }

  .hp-rail--news,
  .hp-rail--projects {
    grid-auto-columns: 80%;
  }

  .hp-rail--news .news-card {
    min-height: 19.5rem;
    grid-template-rows: 9.5rem 1fr;
  }

  .hp-rail--news .news-card__body {
    padding: 0.9rem 1rem 1.05rem;
  }

  .hp-rail--news .news-card h3 {
    font-size: 0.98rem;
  }

  .hp-rail--news .news-card p {
    font-size: 0.84rem;
    -webkit-line-clamp: 2;
  }

  /* Stats: 2-up clean grid, fully readable */
  .hp-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }

  .hp-stat {
    padding: 1.15rem 0.7rem;
  }

  .hp-stat__icon {
    width: 2.3rem;
    height: 2.3rem;
  }

  .hp-stat__value {
    font-size: clamp(1.6rem, 8vw, 2rem);
  }

  .hp-stat__label {
    font-size: 0.8rem;
  }

  .hp-promo {
    padding: 1.05rem;
    gap: 1rem;
    border-radius: 18px;
  }

  .hp-promo__media {
    aspect-ratio: 5 / 3;
  }

  .hp-promo__copy {
    gap: 0.6rem;
  }

  .hp-promo__copy .button,
  .hp-hero__actions .button {
    width: 100%;
    text-align: center;
  }

  .hp-project {
    grid-template-rows: 8.5rem 1fr;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .hp-rail--news,
  .hp-rail--projects {
    grid-auto-columns: 86%;
  }
}

/* Wide desktop: stats become a single 4-up row */
@media (min-width: 768px) {
  .hp-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ============================================================
   Site-wide polish for internal pages and responsive navigation
   ============================================================ */

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

.site-body {
  background:
    radial-gradient(52rem 36rem at 90% -8%, rgba(159, 78, 168, 0.1), transparent 60%),
    radial-gradient(44rem 30rem at 4% 8%, rgba(251, 162, 3, 0.08), transparent 58%),
    linear-gradient(180deg, #fffdfb 0%, #faf5f0 48%, #fff 100%);
}

.site-body:not(.page-home) main {
  position: relative;
  isolation: isolate;
  overflow-x: clip;
}

.site-body:not(.page-home) main::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 250, 246, 0.76), rgba(255, 250, 246, 0.32)),
    var(--identity-pattern-soft) center / 38rem auto repeat;
  opacity: 0.025;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding: clamp(0.55rem, 1.2vw, 0.85rem) 0;
  background: rgba(255, 250, 246, 0.78);
  border-bottom: 1px solid rgba(29, 80, 71, 0.08);
  box-shadow: 0 14px 44px rgba(15, 32, 39, 0.045);
  backdrop-filter: blur(22px) saturate(155%);
  -webkit-backdrop-filter: blur(22px) saturate(155%);
}

.site-header__inner {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(0.65rem, 1.4vw, 1rem);
}

.brand {
  min-width: 0;
}

.brand__mark {
  width: auto;
  object-fit: contain;
}

.brand__text {
  min-width: 0;
}

.brand__text strong,
.brand__text small {
  white-space: nowrap;
}

.site-nav {
  justify-self: center;
  min-width: 0;
}

.site-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 100%;
  margin: 0;
  padding: 0.28rem;
  list-style: none;
  border: 1px solid rgba(29, 80, 71, 0.09);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  box-shadow: 0 10px 28px rgba(15, 32, 39, 0.05);
}

.site-nav li {
  display: flex;
  min-width: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.15rem;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  color: #43515b;
  font-size: clamp(0.76rem, 0.88vw, 0.9rem);
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition:
    color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.site-nav a:hover {
  color: var(--green-deep);
  background: rgba(29, 80, 71, 0.06);
  transform: translateY(-1px);
}

.site-nav a.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--green), #2f7469);
  box-shadow: 0 10px 22px rgba(29, 80, 71, 0.18);
}

.site-header__actions {
  display: inline-flex;
  align-items: center;
  justify-content: end;
  gap: 0.55rem;
  min-width: 0;
}

.header-cta {
  min-height: 2.35rem;
  padding-inline: 0.9rem;
  border-color: rgba(29, 80, 71, 0.16);
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 10px 26px rgba(15, 32, 39, 0.05);
  color: var(--green-deep);
  font-size: 0.82rem;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  flex: 0 0 auto;
  width: 2.7rem;
  height: 2.7rem;
  align-items: center;
  justify-content: center;
  gap: 0.24rem;
  padding: 0;
  border: 1px solid rgba(29, 80, 71, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 28px rgba(15, 32, 39, 0.07);
  cursor: pointer;
}

.menu-toggle > span:not(.sr-only) {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: var(--green-deep);
  transform-origin: center;
  transition: transform 180ms ease, opacity 180ms ease;
}

.menu-toggle > .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.menu-toggle[aria-expanded="true"] > span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] > span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] > span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.site-body:not(.page-home) .page-hero,
.project-detail-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(320px, 0.98fr);
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
  margin-top: clamp(1rem, 2vw, 1.6rem);
  margin-bottom: clamp(1.2rem, 2.6vw, 2rem);
  padding: clamp(1.2rem, 3vw, 2.4rem);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: clamp(1.35rem, 3vw, 2.25rem);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 246, 240, 0.72)),
    rgba(255, 255, 255, 0.62);
  box-shadow:
    0 24px 70px rgba(15, 32, 39, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.site-body:not(.page-home) .page-hero::before,
.project-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--identity-pattern-soft) center / 34rem auto repeat;
  opacity: 0.045;
}

.site-body:not(.page-home) .page-hero::after,
.project-detail-hero::after {
  content: "";
  position: absolute;
  inset: auto -6rem -8rem auto;
  z-index: -1;
  width: 18rem;
  height: 18rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(251, 162, 3, 0.22), transparent 65%);
  filter: blur(10px);
}

.page-hero__content,
.project-detail-hero__copy {
  display: grid;
  gap: 0.82rem;
  min-width: 0;
}

.page-hero__content h1,
.project-detail-hero__copy h1 {
  max-width: 14ch;
  color: var(--green-deep);
  font-size: clamp(2rem, 4.8vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.page-hero__content p,
.project-detail-hero__copy p {
  max-width: 44rem;
  color: #344851;
}

.page-hero__chips,
.page-overview__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}

.page-hero__chips span,
.page-hero__chips a,
.page-overview__chips span,
.page-overview__chips a {
  min-height: 2.05rem;
  padding: 0.36rem 0.74rem;
  border: 1px solid rgba(29, 80, 71, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 800;
  text-decoration: none;
}

.page-hero__chips a.is-active,
.page-overview__chips a.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--green), #2f7469);
}

.page-hero__visual,
.page-hero__visual--cards,
.project-detail-hero__media {
  min-width: 0;
}

.page-hero__visual--cards {
  display: grid;
  gap: 0.85rem;
}

.page-hero__frame,
.page-hero__panel,
.page-hero__note,
.project-detail-hero__media {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 1.35rem;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 44px rgba(15, 32, 39, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.page-hero__frame,
.project-detail-hero__media {
  overflow: hidden;
  min-height: min(24rem, 54vw);
}

.page-hero__frame img,
.project-detail-hero__media img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

.page-hero__panel--accent {
  background:
    linear-gradient(135deg, rgba(29, 80, 71, 0.94), rgba(47, 116, 105, 0.9)),
    rgba(29, 80, 71, 0.9);
  color: #fff;
}

.site-body:not(.page-home) .section {
  position: relative;
  padding-block: clamp(2.7rem, 5vw, 4.8rem);
}

.section-head h2 {
  color: var(--green-deep);
}

.section-head p {
  color: var(--muted);
}

.story-panel,
.value-card,
.palette-swatch,
.project-library-overview,
.project-folder-card,
.mosaic-panel,
.process-step,
.magazine-directory-card,
.news-card,
.dashboard-card,
.dashboard-list-card,
.product-card,
.contact-card,
.contact-form,
.faq-item,
.question-sidebar,
.quiz-card,
.arcade-board,
.qr-studio__builder,
.qr-preview-card,
.qr-logic-card,
.resource-card,
.project-directory-card {
  border-color: rgba(255, 255, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 248, 244, 0.68)),
    rgba(255, 255, 255, 0.7);
  box-shadow: 0 18px 46px rgba(15, 32, 39, 0.08);
  backdrop-filter: blur(16px) saturate(145%);
  -webkit-backdrop-filter: blur(16px) saturate(145%);
}

.story-panel,
.project-library-overview,
.contact-layout,
.question-hub__layout,
.arcade-layout,
.qr-studio__layout,
.dashboard-columns,
.project-detail-hero,
.about-mosaic {
  min-width: 0;
}

.news-scroller,
.hp-rail,
.project-catalog,
.magazine-directory,
.project-directory,
.product-grid,
.values-grid,
.palette-grid,
.process-grid,
.dashboard-grid,
.project-resource-grid,
.field-grid {
  min-width: 0;
}

@media (max-width: 1180px) {
  .site-nav a {
    padding-inline: 0.58rem;
    font-size: 0.78rem;
  }

  .header-cta {
    padding-inline: 0.72rem;
  }
}

@media (max-width: 980px) {
  .site-header__inner {
    grid-template-columns: auto 1fr auto;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.55rem);
    inset-inline: 0;
    z-index: 90;
    display: none;
    justify-self: stretch;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    padding: 0.7rem;
    border-radius: 1.15rem;
    background: rgba(255, 253, 250, 0.99);
    box-shadow: 0 24px 60px rgba(15, 32, 39, 0.14);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
  }

  .site-nav a {
    width: 100%;
    min-height: 2.45rem;
    justify-content: center;
  }

  .menu-toggle {
    display: inline-flex;
    flex-direction: column;
  }

  .site-body:not(.page-home) .page-hero,
  .project-detail-hero {
    grid-template-columns: 1fr;
  }

  .contact-layout,
  .question-hub__layout,
  .arcade-layout,
  .qr-studio__layout,
  .dashboard-columns,
  .story-panel,
  .project-library-overview,
  .project-detail-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .project-catalog,
  .project-catalog--full,
  .magazine-directory,
  .project-directory,
  .product-grid,
  .values-grid,
  .palette-grid,
  .process-grid,
  .dashboard-grid,
  .project-resource-grid,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .section-head--split,
  .arcade-board__top,
  .arcade-board__footer,
  .quiz-card__top,
  .quiz-card__actions {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .news-scroller,
  .article-type-rail {
    grid-auto-columns: minmax(17rem, 82%);
  }
}

@media (max-width: 640px) {
  html {
    font-size: 14px;
  }

  .shell {
    width: min(100% - 1rem, 1180px);
  }

  .site-header {
    padding-block: 0.42rem;
    background: rgba(255, 250, 246, 0.94);
  }

  .brand__mark {
    height: 2.1rem;
  }

  .brand__text strong {
    max-width: 8.5rem;
    overflow: hidden;
    font-size: 0.82rem;
    text-overflow: ellipsis;
  }

  .brand__text small {
    display: none;
  }

  .header-cta {
    display: none;
  }

  .site-nav ul {
    grid-template-columns: 1fr;
  }

  .site-body:not(.page-home) .page-hero,
  .project-detail-hero {
    margin-top: 0.75rem;
    padding: 0.95rem;
    border-radius: 1.15rem;
  }

  .page-hero__content h1,
  .project-detail-hero__copy h1 {
    max-width: 100%;
    font-size: clamp(1.55rem, 8vw, 2.25rem);
    line-height: 1.16;
  }

  .page-hero__content p,
  .project-detail-hero__copy p {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .page-hero__chips,
  .page-overview__chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }

  .page-hero__chips::-webkit-scrollbar,
  .page-overview__chips::-webkit-scrollbar {
    display: none;
  }

  .page-hero__chips span,
  .page-hero__chips a,
  .page-overview__chips span,
  .page-overview__chips a {
    flex: 0 0 auto;
  }

  .page-hero__frame,
  .project-detail-hero__media {
    min-height: 14rem;
  }

  .site-body:not(.page-home) .section {
    padding-block: 2.2rem;
  }

  .arcade-stage__canvas {
    min-height: 18rem;
  }
}

/* ============================================================
   RTL article cards and premium carousel controls
   ============================================================ */

.site-body :where(
  .news-card,
  .product-card,
  .project-folder-card,
  .resource-card,
  .magazine-directory-card,
  .dashboard-list-card,
  .contact-card,
  .faq-item,
  .quiz-card,
  .question-sidebar
) {
  direction: rtl;
  text-align: start;
}

.news-card__body,
.news-card__meta,
.news-card h3,
.news-card p,
.news-card .text-link {
  direction: rtl;
  text-align: right;
}

.news-card__body {
  justify-items: start;
}

.news-card__meta {
  justify-content: flex-start;
}

.news-card .text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 0.42rem;
  width: fit-content;
}

.news-card .text-link::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 180ms ease;
}

.news-card .text-link:hover::after {
  transform: translateX(-0.18rem) rotate(45deg);
}

.news-scroller,
.photo-scroller,
.article-type-rail,
.hp-rail {
  direction: rtl;
}

.news-scroller__item,
.hp-rail__item,
.photo-strip-card {
  direction: rtl;
  scroll-snap-align: start;
}

.news-scroller,
.article-type-rail,
.hp-rail {
  scroll-padding-inline: 0.4rem;
}

.article-type-rail {
  grid-auto-columns: clamp(18rem, 30vw, 24rem);
  gap: clamp(0.85rem, 1.4vw, 1.1rem);
  padding: 0.45rem 0.35rem 1.35rem;
  scrollbar-width: none;
}

.article-type-rail::-webkit-scrollbar {
  display: none;
}

.article-type-rail .news-card,
.article-type-rail .news-card:first-child {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: 12.2rem 1fr;
  height: 24.4rem;
  border-radius: 1.45rem;
  border: 1px solid rgba(29, 80, 71, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 248, 244, 0.88)),
    rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 58px rgba(15, 32, 39, 0.11);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.article-type-rail .news-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 0.28rem;
  background: linear-gradient(90deg, var(--green), var(--purple), var(--gold));
  opacity: 0.82;
}

.article-type-rail .news-card:hover {
  transform: translateY(-0.35rem);
  border-color: rgba(29, 80, 71, 0.16);
  box-shadow: 0 28px 72px rgba(15, 32, 39, 0.16);
}

.article-type-rail .news-card__media,
.article-type-rail .news-card:first-child .news-card__media {
  min-height: 0;
  height: 100%;
  aspect-ratio: auto;
  background:
    radial-gradient(circle at 18% 14%, rgba(159, 78, 168, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(245, 237, 232, 0.92), rgba(255, 255, 255, 0.82));
}

.article-type-rail .news-card__media img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
  transition: transform 260ms ease;
}

.article-type-rail .news-card:hover .news-card__media img {
  transform: scale(1.045);
}

.article-type-rail .news-card__body {
  display: grid;
  align-content: start;
  gap: 0.58rem;
  padding: 1.02rem 1.08rem 1.12rem;
}

.article-type-rail .news-card__meta {
  gap: 0.46rem;
  color: var(--purple-deep);
  font-size: 0.76rem;
  font-weight: 800;
}

.article-type-rail .news-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(159, 78, 168, 0.12);
  border-radius: 999px;
  background: rgba(255, 245, 249, 0.86);
}

.article-type-rail .news-card h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--green-deep);
  font-size: clamp(1.02rem, 1.15vw, 1.18rem);
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.article-type-rail .news-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #52606a;
  font-size: 0.88rem;
  line-height: 1.68;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.article-type-rail .text-link {
  margin-top: 0.1rem;
  color: var(--green);
  font-size: 0.86rem;
  font-weight: 900;
}

.rail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: end;
  gap: 0.75rem;
  text-align: right;
}

.rail-actions p {
  max-width: 24rem;
}

.rail-controls {
  direction: rtl;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem;
  border: 1px solid rgba(29, 80, 71, 0.09);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 244, 0.86)),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 16px 38px rgba(15, 32, 39, 0.08);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
}

.rail-controls[data-scrollable="false"] {
  display: none;
}

.rail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  width: auto;
  min-width: 5.35rem;
  height: 2.55rem;
  padding: 0.26rem 0.42rem 0.26rem 0.78rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.rail-button__label {
  white-space: nowrap;
}

.rail-button__icon {
  display: inline-grid;
  width: 1.82rem;
  height: 1.82rem;
  place-items: center;
  border-radius: 999px;
  background: rgba(29, 80, 71, 0.08);
  font-family: var(--display-latin);
  font-size: 1.22rem;
  line-height: 1;
  transition: background 180ms ease, transform 180ms ease;
}

.rail-button:hover:not(:disabled),
.rail-button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: var(--green);
  color: #fff;
  box-shadow: 0 12px 26px rgba(29, 80, 71, 0.16);
  outline: none;
}

.rail-button:hover:not(:disabled) .rail-button__icon,
.rail-button:focus-visible:not(:disabled) .rail-button__icon {
  background: rgba(255, 255, 255, 0.18);
}

.rail-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

@media (max-width: 760px) {
  .article-type-rail {
    grid-auto-columns: minmax(17.2rem, 84%);
    gap: 0.82rem;
    padding-bottom: 1.1rem;
  }

  .article-type-rail .news-card,
  .article-type-rail .news-card:first-child {
    grid-template-rows: 10.5rem 1fr;
    height: 22.4rem;
    border-radius: 1.2rem;
  }

  .article-type-rail .news-card__body {
    padding: 0.88rem 0.92rem 1rem;
  }

  .article-type-rail .news-card h3 {
    font-size: 1rem;
  }

  .article-type-rail .news-card p {
    font-size: 0.82rem;
    -webkit-line-clamp: 3;
  }

  .rail-actions {
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
  }

  .rail-actions p {
    max-width: none;
    width: 100%;
  }

  .rail-controls {
    width: 100%;
    justify-content: space-between;
    border-radius: 1.1rem;
  }

  .rail-button {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 0.45rem;
  }
}

/* ============================================================
   Home page premium rails
   ============================================================ */

.page-home #home-news {
  position: relative;
}

.page-home #home-news::before {
  content: "";
  position: absolute;
  inset: 4rem -1rem auto;
  z-index: -1;
  height: 17rem;
  border-radius: 999px;
  background:
    radial-gradient(circle at 20% 50%, rgba(251, 162, 3, 0.12), transparent 34%),
    radial-gradient(circle at 72% 45%, rgba(159, 78, 168, 0.12), transparent 38%);
  filter: blur(26px);
  opacity: 0.72;
}

.page-home .hp-rail {
  align-items: stretch;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overscroll-behavior-y: auto;
  scroll-padding-inline: 0.45rem;
  padding: 0.55rem 0.35rem 1.45rem;
  scrollbar-width: none;
}

.page-home .hp-rail::-webkit-scrollbar {
  display: none;
}

.page-home .hp-rail__item {
  min-width: 0;
  height: 100%;
}

.page-home .hp-rail--news {
  grid-auto-columns: clamp(20rem, 31vw, 25rem);
  gap: clamp(0.9rem, 1.6vw, 1.18rem);
}

.page-home .hp-rail--news .news-card,
.page-home .hp-rail--news .news-card:first-child {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 12.4rem 1fr;
  height: 24.8rem;
  min-height: 0;
  border: 1px solid rgba(29, 80, 71, 0.08);
  border-radius: 1.55rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 245, 0.92)),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 64px rgba(15, 32, 39, 0.12);
  transform: translateZ(0);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.page-home .hp-rail--news .news-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 0.32rem;
  background: linear-gradient(90deg, var(--green), var(--purple), var(--gold));
}

.page-home .hp-rail--news .news-card:hover {
  transform: translateY(-0.38rem);
  border-color: rgba(29, 80, 71, 0.17);
  box-shadow: 0 30px 78px rgba(15, 32, 39, 0.17);
}

.page-home .hp-rail--news .news-card__media,
.page-home .hp-rail--news .news-card:first-child .news-card__media {
  height: 100%;
  min-height: 0;
  aspect-ratio: auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 12%, rgba(159, 78, 168, 0.14), transparent 32%),
    linear-gradient(135deg, rgba(245, 237, 232, 0.92), rgba(255, 255, 255, 0.84));
}

.page-home .hp-rail--news .news-card__media img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 260ms ease;
}

.page-home .hp-rail--news .news-card:hover .news-card__media img {
  transform: scale(1.055);
}

.page-home .hp-rail--news .news-card__body {
  display: grid;
  align-content: start;
  gap: 0.58rem;
  min-height: 0;
  overflow: hidden;
  padding: 1rem 1.08rem 1.12rem;
}

.page-home .hp-rail--news .news-card__meta {
  gap: 0.46rem;
  color: var(--purple-deep);
  font-size: 0.76rem;
  font-weight: 900;
}

.page-home .hp-rail--news .news-card__meta span {
  display: inline-flex;
  align-items: center;
  min-height: 1.64rem;
  padding: 0.22rem 0.5rem;
  border: 1px solid rgba(159, 78, 168, 0.12);
  border-radius: 999px;
  background: rgba(255, 245, 249, 0.88);
}

.page-home .hp-rail--news .news-card h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--green-deep);
  font-size: clamp(1.04rem, 1.18vw, 1.2rem);
  font-weight: 900;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.page-home .hp-rail--news .news-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #52606a;
  font-size: 0.88rem;
  line-height: 1.68;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.page-home .hp-rail--news .news-card .text-link {
  align-self: end;
  margin-top: 0.05rem;
  color: var(--green);
  font-size: 0.87rem;
  font-weight: 900;
}

.page-home .hp-section__head .rail-controls[data-scrollable="true"] {
  display: inline-flex;
}

.page-home .hp-section__head .rail-controls[data-scrollable="false"] {
  display: none;
}

@media (max-width: 760px) {
  .page-home .hp-section__head {
    align-items: stretch;
  }

  .page-home .hp-section__head .rail-controls[data-scrollable="true"] {
    display: flex;
  }

  .page-home .hp-rail {
    scroll-snap-type: x mandatory;
    padding: 0.4rem 0.2rem 1.1rem;
  }

  .page-home .hp-rail--news {
    grid-auto-columns: minmax(18.4rem, 86%);
    gap: 0.86rem;
  }

  .page-home .hp-rail--news .news-card,
  .page-home .hp-rail--news .news-card:first-child {
    grid-template-rows: 10.9rem 1fr;
    height: 23.35rem;
    border-radius: 1.25rem;
  }

  .page-home .hp-rail--news .news-card__body {
    padding: 0.88rem 0.94rem 1rem;
  }

  .page-home .hp-rail--news .news-card h3 {
    font-size: 1rem;
    line-height: 1.44;
  }

  .page-home .hp-rail--news .news-card p {
    font-size: 0.82rem;
    -webkit-line-clamp: 3;
  }
}

@media (max-width: 420px) {
  .page-home .hp-rail--news {
    grid-auto-columns: minmax(17.4rem, 88%);
  }

  .page-home .hp-rail--news .news-card,
  .page-home .hp-rail--news .news-card:first-child {
    height: 22.7rem;
  }
}
