/* ═══════════════════════════════════════════════
   WORK PAGE
   Editorial project list — not a gallery.
   Typographic hierarchy is the entire design.
   ═══════════════════════════════════════════════ */

/* ── IRAN Kharazmi — Persian display font ────── */
@font-face {
  font-family: 'IRAN Kharazmi';
  src: url('fonts/IRAN Kharazmi.eot');
  src: url('fonts/IRAN Kharazmi.eot?#iefix') format('embedded-opentype'),
       url('fonts/IRAN Kharazmi.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-fa-display: 'IRAN Kharazmi', 'Vazirmatn', Tahoma, sans-serif;
}

/* ── Page layout ─────────────────────────────── */

/* Unlock scroll (body defaults to overflow: hidden for the homepage) */
body.work-page {
  overflow-y: auto;
  overflow-x: hidden;
}

/* Override the homepage's fixed-height grid page-frame */
body.work-page .page-frame {
  height: auto;
  min-height: 100svh;
  display: block;
}

body.work-page #main-content {
  display: block;
}

/* Pin nav and corners to viewport while content scrolls */
body.work-page .corner,
body.work-page .nav {
  position: fixed;
}

body.work-page .nav {
  top: calc(var(--pad) + 28px);
  inset-inline-end: var(--pad);
  z-index: 20;
}

body.work-page .corner--tl { top: var(--pad); inset-inline-start: var(--pad); }
body.work-page .corner--tr { top: var(--pad); inset-inline-end: var(--pad); }
body.work-page .corner--br { bottom: var(--pad); inset-inline-end: var(--pad); }

/* Footer needs z-index and position so it layers correctly */
body.work-page .footer {
  position: relative;
  z-index: 10;
}

/* ── Nav active state ────────────────────────── */
.nav__link--active {
  color: var(--accent);
}

/* ── Hero section ────────────────────────────── */
.work-hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-inline: var(--pad);
  padding-block: calc(var(--pad) * 4.5) calc(var(--pad) * 3.5);
  position: relative;
}

/* Orientation badge — top-left of hero */
.work-badge {
  position: absolute;
  top: calc(var(--pad) * 3.5);
  inset-inline-start: var(--pad);
  display: flex;
  align-items: center;
  gap: 12px;
  opacity: 0;
  animation: fade-up 0.55s ease 0.1s both;
}

.work-badge__num {
  font-family: var(--font);
  font-size: 0.5rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.work-badge__label {
  font-family: var(--font);
  font-size: 0.5rem;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* ── EN headline ─────────────────────────────── */
.work-hero__headline {
  margin: 0 0 clamp(18px, 2.8vh, 30px);
  line-height: 0.88;
  display: block;
}

.work-hero__line {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 10.5vw, 10rem);
  line-height: 0.88;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  clip-path: inset(0 100% 0 0);
}

.work-hero__line:nth-child(1) {
  animation: work-line-reveal 1s cubic-bezier(0.77, 0, 0.175, 1) 0.22s both;
}

.work-hero__line:nth-child(2) {
  animation: work-line-reveal 1s cubic-bezier(0.77, 0, 0.175, 1) 0.4s both;
  color: var(--accent);
}

@keyframes work-line-reveal {
  0%   { clip-path: inset(0 100% 0 0); }
  100% { clip-path: inset(0 0%   0 0); }
}

/* ── FA headline — independently composed ────── */
.work-hero-fa {
  display: none;
}

[lang="fa"] .work-hero-fa {
  display: block;
  font-family: var(--font-fa-display);
  font-size: clamp(3rem, 8.5vw, 8.5rem);
  line-height: 1.45;
  letter-spacing: 0;
  color: var(--text-bright);
  text-align: right;
  direction: rtl;
  margin: 0 0 clamp(18px, 2.8vh, 30px);
  clip-path: inset(0 0% 0 100%);
  animation: work-line-reveal-rtl 1s cubic-bezier(0.77, 0, 0.175, 1) 0.22s both;
}

[lang="fa"] .work-hero__headline {
  display: none;
}

@keyframes work-line-reveal-rtl {
  0%   { clip-path: inset(0 0% 0 100%); }
  100% { clip-path: inset(0 0% 0 0%);   }
}

/* ── Hero subtitle ───────────────────────────── */
.work-hero__sub {
  font-family: var(--font);
  font-size: clamp(0.62rem, 1vw, 0.74rem);
  letter-spacing: 0.05em;
  line-height: 2;
  color: var(--text-mid);
  max-width: 480px;
  margin: 0 0 clamp(28px, 4vh, 44px);
  opacity: 0;
  animation: fade-up 0.55s ease 0.62s both;
}

[lang="fa"] .work-hero__sub {
  font-family: var(--font-fa);
  font-size: clamp(0.8rem, 1.1vw, 0.92rem);
  letter-spacing: 0;
  line-height: 2.3;
  text-align: right;
  max-width: 520px;
}

/* ── Scroll hint ─────────────────────────────── */
.work-scroll {
  font-family: var(--font);
  font-size: 0.5rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
  opacity: 0;
  animation: fade-up 0.55s ease 0.82s both;
}

/* ── Project section ─────────────────────────── */
.work-section {
  padding-inline: var(--pad);
  padding-block: 0 clamp(60px, 8vh, 100px);
}

/* Section-level rule — above the first project */
.work-section__rule {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 0;
}

.work-rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--text-mid), transparent);
  opacity: 0.25;
}

.work-rule-diamond {
  font-size: 0.32rem;
  color: var(--text-dim);
  opacity: 0.55;
}

/* ── Project list ────────────────────────────── */
.project-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ── Individual project item ─────────────────── */
.project-item {
  padding-block: clamp(40px, 5.5vh, 64px);
}

/* Meta row: index · category · year */
.project-item__meta {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 2vw, 28px);
  margin-bottom: clamp(14px, 2.2vh, 22px);
}

.project-item__index {
  font-family: var(--font);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0.8;
  flex-shrink: 0;
}

.project-item__category {
  font-family: var(--font);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  flex: 1;
}

.project-item__year {
  font-family: var(--font);
  font-size: 0.5rem;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-inline-start: auto;
  flex-shrink: 0;
}

/* Project title — the editorial centerpiece */
.project-item__title {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 7vw, 6.5rem);
  line-height: 0.9;
  letter-spacing: -0.01em;
  color: var(--text-bright);
  margin: 0 0 clamp(20px, 3vh, 32px);
  transition: color 0.3s ease;
  cursor: default;
}

.project-item:hover .project-item__title {
  color: var(--accent);
}

/* Challenge — the human context */
.project-item__challenge {
  font-family: var(--font);
  font-size: clamp(0.64rem, 0.9vw, 0.72rem);
  letter-spacing: 0.03em;
  line-height: 2;
  color: var(--text-mid);
  max-width: 640px;
  margin: 0 0 clamp(8px, 1.4vh, 14px);
}

/* Result — the story's payoff, in italics */
.project-item__result {
  font-family: var(--font);
  font-size: clamp(0.64rem, 0.9vw, 0.72rem);
  letter-spacing: 0.03em;
  line-height: 2;
  color: var(--text-dim);
  max-width: 640px;
  margin: 0 0 clamp(18px, 2.8vh, 28px);
  font-style: italic;
}

/* Footer: tags + status */
.project-item__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.project-item__tags {
  font-family: var(--font);
  font-size: 0.48rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  line-height: 1.8;
  margin: 0;
}

.project-item__status {
  font-family: var(--font);
  font-size: 0.48rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  flex-shrink: 0;
}

/* Separator between projects */
.project-item__rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(40px, 5.5vh, 64px);
}

.project-item__rule-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--text-mid), transparent);
  opacity: 0.18;
}

.project-item__rule-diamond {
  font-size: 0.28rem;
  color: var(--text-dim);
  opacity: 0.45;
}

/* Hide rule after the last project */
.project-item:last-child .project-item__rule {
  display: none;
}

/* ── Persian project typography ──────────────── */
[lang="fa"] .project-item__title {
  font-family: var(--font-fa-display);
  font-size: clamp(2.2rem, 5.8vw, 5.5rem);
  line-height: 1.35;
  letter-spacing: 0;
}

[lang="fa"] .project-item__challenge,
[lang="fa"] .project-item__result {
  font-family: var(--font-fa);
  font-size: clamp(0.78rem, 1.05vw, 0.9rem);
  letter-spacing: 0;
  line-height: 2.2;
  font-style: normal;
}

[lang="fa"] .project-item__result {
  opacity: 0.75;
}

[lang="fa"] .project-item__index,
[lang="fa"] .project-item__category,
[lang="fa"] .project-item__year {
  font-family: var(--font-fa);
  font-size: clamp(0.62rem, 0.75vw, 0.7rem);
  letter-spacing: 0;
}

[lang="fa"] .project-item__tags {
  font-family: var(--font-fa);
  font-size: clamp(0.65rem, 0.75vw, 0.72rem);
  letter-spacing: 0;
}

[lang="fa"] .project-item__status {
  font-family: var(--font-fa);
  font-size: clamp(0.65rem, 0.75vw, 0.72rem);
  letter-spacing: 0;
}

/* ── Scroll reveal ───────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

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

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── Stagger: each project item delays on reveal ─ */
.project-item:nth-child(1) { transition-delay: 0s;    }
.project-item:nth-child(2) { transition-delay: 0.06s; }
.project-item:nth-child(3) { transition-delay: 0.12s; }
.project-item:nth-child(4) { transition-delay: 0.18s; }
.project-item:nth-child(5) { transition-delay: 0.24s; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 900px) {
  .work-hero__line {
    font-size: clamp(3.2rem, 9.5vw, 8rem);
  }

  .project-item__title {
    font-size: clamp(2.4rem, 6.5vw, 5.5rem);
  }

  [lang="fa"] .project-item__title {
    font-size: clamp(1.9rem, 5.5vw, 4.5rem);
  }
}

@media (max-width: 600px) {
  .work-hero {
    padding-block: calc(var(--pad) * 5) calc(var(--pad) * 2.5);
    justify-content: flex-end;
  }

  .work-hero__line {
    font-size: clamp(2.6rem, 10vw, 4.5rem);
  }

  [lang="fa"] .work-hero-fa {
    font-size: clamp(2.2rem, 9vw, 4rem);
  }

  .work-hero__sub {
    max-width: 100%;
  }

  .project-item {
    padding-block: clamp(28px, 5vh, 44px);
  }

  .project-item__title {
    font-size: clamp(2rem, 8.5vw, 3.5rem);
  }

  [lang="fa"] .project-item__title {
    font-size: clamp(1.7rem, 7.5vw, 3rem);
  }

  .project-item__meta {
    flex-wrap: wrap;
    gap: 8px;
  }

  .project-item__year {
    margin-inline-start: 0;
  }

  .project-item__challenge,
  .project-item__result {
    max-width: 100%;
  }

  .project-item__footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}
