/* ==========================================================================
   ملف إنجاز المعلمة / فاطمة عبد الحميد الرايقي
   Direction: soft rose editorial RTL portfolio. Deep rose + blush + pale pink,
   white cards. Signature: the "folio" — an engraved botanical seal that also
   marks each evidence card. Names of the tokens are kept from the original
   design system so the layout rules below do not need rewriting.
   ========================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --ink: #831843;          /* عناوين ونصوص الخلفيات الداكنة — 8.3:1 على الأبيض */
  --ink-soft: #A21C5B;     /* تمرير وروابط */
  --sage: #FCE7F3;         /* الوردي الفاتح */
  --sage-deep: #FBCFE8;    /* حدود وردية */
  --white: #FFFFFF;
  --mist: #FDF2F8;         /* خلفية باهتة */
  --ochre: #DB2777;        /* لون الإجراء وعلامات نشطة — 4.6:1 على الأبيض */
  --ochre-line: #DB2777;
  --muted: #705366;        /* نص ثانوي بلمحة برقوقية — 6.4:1 على الأبيض */

  --font-display: "Noto Naskh Arabic", "Amiri", "Traditional Arabic", serif;
  --font-body: "Noto Sans Arabic", "Segoe UI", "Tahoma", "Arial", sans-serif;

  --step--1: clamp(0.8rem, 0.77rem + 0.14vw, 0.875rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --step-2: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.2vw, 5.25rem);

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;
  --space-2xl: 3.5rem;
  --space-3xl: clamp(4rem, 8vw, 7.5rem);
  --gutter: clamp(1.25rem, 4.5vw, 3rem);
  --max: 1180px;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 260ms;

  --header-h: 6.25rem;
  --hairline: 1px solid color-mix(in srgb, var(--ink) 14%, transparent);
}

/* --- Reset -------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.85;
  color: var(--ink);
  background: var(--white);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body.is-locked {
  overflow: hidden;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

/* --- Focus -------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: 4px;
}

/* حدود التركيز بلون الوردي العميق على الخلفيات الفاتحة (الترويسة، الغلاف،
   التذييل)، وأبيض فقط على الخلفيتين الداكنتين: قسم الرسالة والمعاينة. */
.vision :focus-visible,
.lightbox :focus-visible {
  outline-color: var(--white);
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -100px;
  z-index: 120;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur) var(--ease);
}

.skip-link:focus {
  top: 1rem;
}

/* --- Utilities ---------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - (var(--gutter) * 2), var(--max));
  margin-inline: auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--ochre);
}

.section-head {
  display: grid;
  gap: var(--space-sm);
  max-width: 44rem;
  margin-block-end: var(--space-xl);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.005em;
}

.section-lede {
  color: var(--muted);
  max-width: 40rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--white) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-block-end: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  transition: box-shadow var(--dur) var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 10px 30px -22px color-mix(in srgb, var(--ink) 60%, transparent);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm) var(--space-lg);
  padding-block: var(--space-md);
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  min-height: 44px;
}

.brand-mono {
  display: grid;
  place-items: center;
  flex: none;
  width: 52px;
  height: 52px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
  color: var(--white);
  background: var(--ink);
  border-radius: 50% 50% 50% 4px;
  border: 1px solid var(--ink);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.brand:hover .brand-mono {
  background: var(--ink-soft);
  transform: rotate(-3deg);
}

.brand-text {
  display: grid;
  line-height: 1.4;
}

.brand-name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 700;
}

.brand-role {
  font-size: var(--step--1);
  color: var(--muted);
}

.primary-nav {
  margin-inline-start: auto;
}

.primary-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-xs);
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-sm);
  font-size: var(--step-0);
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--radius-sm);
  position: relative;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.primary-nav a::after {
  content: "";
  position: absolute;
  inset-inline: var(--space-sm);
  bottom: 6px;
  height: 1px;
  background: var(--ochre);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur) var(--ease);
}

.primary-nav a:hover {
  color: var(--ink-soft);
}

.primary-nav a:hover::after,
.primary-nav a[aria-current="true"]::after {
  transform: scaleX(1);
}

.primary-nav a[aria-current="true"] {
  font-weight: 600;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 32px;
  padding-inline: 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--mist);
  border: 1px solid var(--ochre-line);
  border-radius: 999px;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ochre);
}

/* Hairline "index tab" under the header — a page-top detail, not decoration
   for its own sake: it echoes the printed tabs of a teacher's binder. */
.header-index {
  display: none;
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% -10%, color-mix(in srgb, var(--sage) 70%, transparent) 0%, transparent 60%),
    linear-gradient(180deg, var(--mist) 0%, var(--white) 100%);
  border-block-end: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 0.82fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3.5rem, 8vw, 7rem);
}

.hero-thesis {
  font-family: var(--font-display);
  font-size: var(--step-4);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-block: var(--space-md) var(--space-lg);
  text-wrap: balance;
}

.hero-thesis .thread {
  position: relative;
  white-space: nowrap;
}

.hero-thesis .thread::after {
  content: "";
  position: absolute;
  inset-inline: -0.06em;
  bottom: 0.16em;
  height: 0.32em;
  background: linear-gradient(90deg, color-mix(in srgb, var(--sage) 95%, transparent), color-mix(in srgb, var(--sage) 45%, transparent));
  z-index: -1;
  border-radius: 2px;
}

.hero-thesis .thread {
  z-index: 0;
}

.hero-lede {
  font-size: var(--step-1);
  line-height: 1.8;
  color: var(--muted);
  max-width: 34rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  margin-block-start: var(--space-lg);
  padding-block-start: var(--space-md);
  border-block-start: var(--hairline);
  font-size: var(--step--1);
  color: var(--muted);
}

.hero-meta dt {
  display: none;
}

.hero-meta dd {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-meta dd::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid var(--ochre);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-block-start: var(--space-xl);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--ochre);
  background: var(--ochre);
  color: var(--white);
  font-size: var(--step-0);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.btn:hover {
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ochre) 60%, transparent);
}

.btn--ghost:hover {
  background: var(--ochre);
  color: var(--white);
  border-color: var(--ochre);
}

.btn .arrow {
  transition: transform var(--dur) var(--ease);
}

.btn:hover .arrow {
  transform: translateX(-3px);
}

/* --- Hero folio (signature element) ------------------------------------- */
.folio {
  position: relative;
  justify-self: center;
  width: min(100%, 420px);
  aspect-ratio: 1 / 1.08;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.folio-sheet {
  position: absolute;
  inset: 0;
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 4rem;
  box-shadow:
    0 1px 0 color-mix(in srgb, var(--ink) 6%, transparent),
    0 30px 60px -40px color-mix(in srgb, var(--ink) 55%, transparent);
}

.folio-seal {
  position: relative;
  width: 78%;
  height: auto;
  color: var(--ink);
}

.folio-seal .draw path,
.folio-seal .draw circle,
.folio-seal .draw line {
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: 0;
}

.js .folio-seal .draw path,
.js .folio-seal .draw circle,
.js .folio-seal .draw line {
  animation: draw-in 1600ms var(--ease) both;
  animation-delay: var(--delay, 200ms);
}

@keyframes draw-in {
  from {
    stroke-dashoffset: var(--len, 600);
  }
  to {
    stroke-dashoffset: 0;
  }
}

.folio-caption {
  position: absolute;
  inset-block-end: 1.35rem;
  inset-inline: 1.35rem;
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 0.76rem;
  color: var(--muted);
  border-block-start: 1px solid color-mix(in srgb, var(--ochre) 45%, transparent);
  padding-block-start: 0.65rem;
}

.folio-tab {
  position: absolute;
  inset-inline-end: -1.1rem;
  inset-block-start: 2.2rem;
  writing-mode: vertical-rl;
  padding: 0.9rem 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--ink);
  background: var(--sage);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section {
  padding-block: var(--space-3xl);
}

.section--mist {
  background: var(--mist);
  border-block: 1px solid color-mix(in srgb, var(--ink) 7%, transparent);
}

/* --- About -------------------------------------------------------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
}

.about-body {
  display: grid;
  gap: var(--space-md);
  color: var(--muted);
  text-wrap: pretty;
}

.about-body strong {
  color: var(--ink);
  font-weight: 600;
}

.facts {
  display: grid;
  gap: 0;
  margin-block-start: var(--space-lg);
  border-block-start: var(--hairline);
}

.facts div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-xs) var(--space-md);
  padding-block: 0.85rem;
  border-block-end: var(--hairline);
}

.facts dt {
  font-size: var(--step--1);
  color: var(--muted);
}

.facts dd {
  margin: 0;
  font-weight: 600;
}

.facts dd.link {
  font-weight: 500;
}

.facts dd.link a {
  text-decoration-color: var(--ochre-line);
  text-underline-offset: 4px;
}

.facts dd.link a:hover {
  text-decoration-color: var(--ochre);
}

/* --- Evidence ----------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-block-end: var(--space-md);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 44px;
  padding-inline: 1rem;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.chip:hover {
  border-color: var(--ink);
}

.chip .chip-count {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--muted);
  transition: color var(--dur) var(--ease);
}

.chip[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

.chip[aria-pressed="true"] .chip-count {
  color: color-mix(in srgb, var(--white) 70%, var(--sage));
}

.filter-status {
  font-size: var(--step--1);
  color: var(--muted);
  min-height: 1.6em;
  margin-block-end: var(--space-lg);
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
  gap: var(--space-lg);
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--ink) 11%, transparent);
  border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.card:hover {
  border-color: color-mix(in srgb, var(--ochre) 55%, transparent);
  box-shadow: 0 22px 40px -34px color-mix(in srgb, var(--ink) 70%, transparent);
  transform: translateY(-2px);
}

.card[hidden] {
  display: none;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
}

.card-index {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.card-index::before {
  content: "";
  width: 18px;
  height: 18px;
  background-color: var(--sage);
  border-radius: 50% 50% 50% 2px;
  border: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}

.card-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.45;
}

.card-meta {
  font-size: var(--step--1);
  color: var(--muted);
}

.card-link {
  align-self: stretch;
  margin-block-start: auto;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  min-height: 44px;
  padding-block-start: var(--space-sm);
  border-block-start: var(--hairline);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.card-link:hover {
  color: var(--ink-soft);
}

.card-link .open {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.card-link .open svg {
  transition: transform var(--dur) var(--ease);
}

.card-link:hover .open svg {
  transform: translate(-2px, -2px);
}

/* Stretched link so the whole card is clickable while keeping one real link
   and its accessible name intact. */
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card-link:focus-visible {
  outline: none;
}

.card-link:focus-visible::after {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* --- Gallery ------------------------------------------------------------ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(1.25rem, 3vw, 2rem);
}

.shot {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
}

.shot-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--sage);
  cursor: zoom-in;
  min-height: 44px;
  position: relative;
  overflow: hidden;
}

.shot-btn img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
  transition: transform 600ms var(--ease), filter var(--dur) var(--ease);
}

.shot--tall .shot-btn img {
  object-position: top center;
}

.shot-btn:hover img {
  transform: scale(1.035);
}

.shot-btn::after {
  content: "عرض الصفحة";
  position: absolute;
  inset-inline-start: 0.85rem;
  inset-block-start: 0.85rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--ink);
  background: color-mix(in srgb, var(--white) 94%, transparent);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.shot-btn:hover::after,
.shot-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.shot-body {
  display: grid;
  gap: 0.3rem;
  padding: var(--space-md) var(--space-lg) var(--space-lg);
}

.shot-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
}

.shot-caption {
  font-size: var(--step--1);
  color: var(--muted);
}

.gallery-note {
  margin-block-start: var(--space-lg);
  font-size: var(--step--1);
  color: var(--muted);
}

/* --- Vision (closing dark section) -------------------------------------- */
.vision {
  background: var(--ink);
  color: color-mix(in srgb, var(--white) 90%, var(--sage));
}

.vision .section-title {
  color: var(--white);
  margin-block-end: var(--space-md);
}

.vision .eyebrow {
  color: var(--sage);
}

.vision .eyebrow::before {
  background: var(--sage);
}

.vision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.vision p {
  max-width: 36rem;
}

.vision .btn {
  border-color: var(--white);
  background: var(--white);
  color: var(--ink);
}

.vision .btn:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--ink);
}

.vision-aside {
  padding: var(--space-lg);
  border: 1px dashed color-mix(in srgb, var(--sage) 45%, transparent);
  border-radius: var(--radius);
  font-size: var(--step--1);
  line-height: 1.9;
}

.vision-aside h3 {
  font-family: var(--font-display);
  font-size: var(--step-1);
  margin-block-end: var(--space-sm);
  color: var(--white);
}

.vision-list {
  display: grid;
  gap: var(--space-xs);
}

.vision-list li {
  padding-block-end: var(--space-xs);
  border-block-end: 1px solid color-mix(in srgb, var(--sage) 22%, transparent);
}

.vision-list li:last-child {
  padding-block-end: 0;
  border-block-end: 0;
}

.vision-list strong {
  color: var(--white);
  font-weight: 600;
}

/* --- Footer ------------------------------------------------------------- */
.footer {
  padding-block: var(--space-xl);
  background: var(--mist);
  border-block-start: 1px solid color-mix(in srgb, var(--ink) 8%, transparent);
  font-size: var(--step--1);
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm) var(--space-lg);
}

.footer-mono {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  background: var(--ink);
  border-radius: 50% 50% 50% 3px;
}

.footer-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.footer a {
  text-underline-offset: 4px;
  text-decoration-color: var(--ochre-line);
}

.footer a:hover {
  color: var(--ink);
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding-inline: 0.25rem;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-md);
  padding: clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: var(--white);
  opacity: 0;
  visibility: hidden;
  transition: opacity 220ms var(--ease), visibility 220ms var(--ease);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
}

.lightbox-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.5;
}

.lightbox-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--white) 35%, transparent);
  background: transparent;
  color: var(--white);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}

.lightbox-close:hover {
  background: color-mix(in srgb, var(--white) 14%, transparent);
}

.lightbox-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: auto;
}

.lightbox-stage img {
  max-height: min(76vh, 100%);
  width: auto;
  border-radius: var(--radius-sm);
  background: var(--white);
  transform: scale(0.985);
  transition: transform 260ms var(--ease);
}

.lightbox.is-open .lightbox-stage img {
  transform: scale(1);
}

.lightbox-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: var(--step--1);
  color: color-mix(in srgb, var(--white) 78%, var(--sage));
}

.lightbox-bottom a {
  color: var(--white);
  text-underline-offset: 4px;
}

.lightbox-bottom a:hover {
  color: var(--sage);
}

/* ==========================================================================
   Reveal motion (progressively enhanced)
   لا يُخفى أي محتوى إلا بعد أن يضيف app.js صنف motion-ready عند جاهزية
   مراقب الكشف. إن فشل السكربت أو تعطّل، يبقى المحتوى ظاهرًا بالكامل.
   ========================================================================== */
.motion-ready .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}

.motion-ready .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid,
  .about-grid,
  .vision-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .folio {
    grid-row: 1;
    width: min(78%, 340px);
    justify-self: start;
  }

  .hero-meta {
    gap: var(--space-xs) var(--space-md);
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 8.5rem;
  }

  .header-inner {
    padding-block: var(--space-sm);
    gap: var(--space-2xs) var(--space-sm);
  }

  .brand-mono {
    width: 44px;
    height: 44px;
    font-size: 1.15rem;
  }

  .badge {
    order: 3;
    margin-inline-start: 0;
  }

  .primary-nav {
    order: 4;
    margin-inline-start: 0;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }

  .primary-nav::-webkit-scrollbar {
    display: none;
  }

  .primary-nav ul {
    flex-wrap: nowrap;
  }

  .primary-nav a {
    padding-inline: 0.65rem;
    white-space: nowrap;
  }

  .nav-tools {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
  }

  .hero-thesis {
    line-height: 1.35;
  }

  .hero-thesis .thread {
    white-space: normal;
  }

  .folio-tab {
    inset-inline-end: -0.75rem;
  }

  .card {
    padding: var(--space-md);
  }
}

@media (max-width: 480px) {
  .hero-actions .btn {
    flex: 1 1 100%;
  }

  .facts div {
    flex-direction: column;
    gap: 0.15rem;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Reduced motion & print
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }

  .js .folio-seal .draw path,
  .js .folio-seal .draw circle,
  .js .folio-seal .draw line {
    animation: none;
    stroke-dashoffset: 0;
  }

  .card:hover,
  .btn:hover {
    transform: none;
  }

  .shot-btn:hover img {
    transform: none;
  }
}

@media print {
  .site-header,
  .filters,
  .filter-status,
  .lightbox,
  .to-top,
  .hero-actions {
    display: none !important;
  }

  .motion-ready .reveal {
    opacity: 1;
    transform: none;
  }

  body {
    color: #000;
  }
}
