/* ============================================================
   Bilad — design tokens (per §3 of BRAND_AND_DESIGN_STANDARD.md)
   ============================================================ */

:root {
  /* Brand neutrals */
  --ink: #1a1715;
  --paper: #f5f1ea;
  --linen: #e8e1d4;
  --stone: #8a8278;
  --hairline: #d8cfbf;

  /* Accents (used sparingly) */
  --saffron: #c77a2e;
  --indigo: #2a3f5f;

  /* Zeljora palette — active colorway zones (set by JS, default below) */
  --zone-ground: #3a3735;   /* Noir 11 */
  --zone-star: #b8b6b1;     /* Touterelle 12 */
  --zone-diamond: #5a5c5d;  /* Anthracite 04 */
  --zone-corner: #d6cfbe;   /* Argile 03 */
  --joint: var(--paper);

  /* Type */
  --display: 'Newsreader', 'GT Sectra', Georgia, serif;
  --sans: 'Inter', -apple-system, system-ui, sans-serif;
  --arabic: 'Tajawal', 'IBM Plex Arabic', sans-serif;

  /* Rhythm */
  --section-y: 160px;
  --gutter: 80px;
  --max: 1440px;
  --rail: 240px;
}

@media (max-width: 900px) {
  :root {
    --section-y: 96px;
    --gutter: 24px;
  }
}

/* ============================================================
   Reset & base
   ============================================================ */

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: 0;
}

@media (max-width: 600px) {
  body { font-size: 16px; }
}

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

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

button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
}

/* ============================================================
   Type scale (per §3.3)
   ============================================================ */

.h1, .h2, .h3 {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
}

.h1 {
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
}

.h2 {
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: 1.1;
}

.h3 {
  font-size: 20px;
  line-height: 1.3;
  font-family: var(--sans);
  font-weight: 500;
  letter-spacing: 0;
}

.eyebrow {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 32px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.lede {
  font-family: var(--display);
  font-size: clamp(20px, 2.4vw, 26px);
  line-height: 1.4;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
  max-width: 36ch;
}

p { margin: 0 0 1em 0; }

.caption {
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--stone);
}

/* ============================================================
   Layout
   ============================================================ */

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

section {
  padding: var(--section-y) 0;
}

.divider {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

/* ============================================================
   Site nav
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 80px;
  display: flex;
  align-items: center;
  padding: 0 var(--gutter);
  transition: background 280ms ease, color 280ms ease, box-shadow 280ms ease;
}

.nav--hero {
  color: var(--paper);
}

.nav--scrolled {
  background: rgba(245, 241, 234, 0.92);
  backdrop-filter: saturate(180%) blur(10px);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--hairline);
}

.wordmark {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.32em;
  text-transform: none;
  /* The B in BILAD is optical-centered by setting it as letters with explicit tracking */
}

.wordmark::before { content: 'BILAD'; }

.nav__menu {
  margin-left: auto;
  display: flex;
  gap: 36px;
  font-size: 14px;
  letter-spacing: 0.04em;
}

.nav__menu a {
  position: relative;
  padding: 4px 0;
}

.nav__menu a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 240ms ease;
}

.nav__menu a:hover::after { transform: scaleX(1); }

@media (max-width: 800px) {
  .nav__menu { display: none; }
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--gutter) 80px var(--gutter);
  color: var(--paper);
  overflow: hidden;
}

.hero__pattern {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: #2a2725;
  filter: saturate(0.9) brightness(0.92);
}

.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.hero__credit {
  position: absolute;
  right: var(--gutter);
  bottom: 16px;
  z-index: 2;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.75);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(26,23,21,0.65) 0%, rgba(26,23,21,0.15) 22%, rgba(26,23,21,0) 45%, rgba(26,23,21,0.85) 100%),
    linear-gradient(90deg, rgba(26,23,21,0.65) 0%, rgba(26,23,21,0) 65%);
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.hero__tagline {
  font-family: var(--display);
  font-size: clamp(44px, 6.4vw, 84px);
  line-height: 1.0;
  letter-spacing: -0.02em;
  font-weight: 400;
  margin: 0 0 32px 0;
}

.hero__lede {
  font-family: var(--sans);
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.55;
  max-width: 44ch;
  margin: 0 0 40px 0;
  color: rgba(245, 241, 234, 0.9);
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 32px;
  background: var(--paper);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 240ms ease, background 240ms ease;
}

.hero__cta:hover {
  background: var(--saffron);
  color: var(--paper);
  transform: translateY(-1px);
}

.hero__cta::after { content: '→'; transition: transform 240ms ease; }
.hero__cta:hover::after { transform: translateX(4px); }

/* ============================================================
   Section: How we work
   ============================================================ */

.how {
  padding: var(--section-y) 0;
}

.how__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--hairline);
  margin-top: 16px;
}

.how__cell {
  background: var(--paper);
  padding: 56px 48px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.how__num {
  font-family: var(--display);
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--stone);
}

.how__title {
  font-family: var(--display);
  font-size: 32px;
  line-height: 1.1;
  font-weight: 400;
  margin: 0;
}

.how__body {
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

@media (max-width: 800px) {
  .how__grid { grid-template-columns: 1fr; }
  .how__cell { padding: 40px 28px; }
}

/* ============================================================
   Section: Featured collection
   ============================================================ */

.featured {
  background: var(--linen);
  padding: 0;
}

.featured__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 720px;
}

.featured__image {
  position: relative;
  background: #2a2725;
  overflow: hidden;
}

.featured__pattern-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: opacity 400ms ease;
}

.featured__pattern-stage svg { width: 100%; height: 100%; display: block; }

.featured__copy {
  padding: 96px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 32px;
}

.featured__meta {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--stone);
}

.featured__title {
  font-family: var(--display);
  font-size: clamp(40px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
}

.featured__body {
  font-size: 17px;
  line-height: 1.6;
  max-width: 44ch;
  margin: 0;
}

.colorway-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 8px 0 24px 0;
}

@media (max-width: 480px) {
  .colorway { width: 44px; height: 44px; }
}

.colorway {
  width: 56px;
  height: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease;
  background: var(--ink);
}

.colorway > span { display: block; }
.colorway:hover { transform: translateY(-2px); }
.colorway.is-active { border-color: var(--ink); outline: 1px solid var(--ink); outline-offset: 2px; }

.btn-text {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 6px;
  align-self: flex-start;
  transition: color 240ms ease, border-color 240ms ease;
}

.btn-text:hover { color: var(--saffron); border-bottom-color: var(--saffron); }
.btn-text::after { content: '→'; transition: transform 240ms ease; }
.btn-text:hover::after { transform: translateX(3px); }

@media (max-width: 900px) {
  .featured__inner { grid-template-columns: 1fr; }
  .featured__image { min-height: 360px; }
  .featured__copy { padding: 56px 28px; }
}

/* ============================================================
   Section: Workshops
   ============================================================ */

.workshops__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 56px;
  gap: 24px;
}

.workshops__counter {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--stone);
  text-transform: uppercase;
}

.workshop-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.workshop-card__image {
  aspect-ratio: 4 / 5;
  background: var(--linen);
  position: relative;
  overflow: hidden;
}

.workshop-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--stone);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  padding: 24px;
  background:
    repeating-linear-gradient(45deg,
      rgba(138,130,120,0.06) 0px,
      rgba(138,130,120,0.06) 1px,
      transparent 1px,
      transparent 8px);
}

.workshop-card__placeholder span { display: block; }

.workshop-card__body { padding: 12px 0; }

.workshop-card__name {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1.05;
  margin: 0 0 12px 0;
}

.workshop-card__meta {
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--stone);
  margin: 0 0 28px 0;
}

.workshop-card__desc {
  font-size: 16px;
  line-height: 1.65;
  margin: 0 0 32px 0;
  max-width: 44ch;
}

.workshops__upcoming {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--hairline);
  font-size: 14px;
  color: var(--stone);
  letter-spacing: 0.02em;
}

.workshops__upcoming b {
  color: var(--ink);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.workshops__upcoming-label { margin: 0 0 24px 0; }

.teaser-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 16px;
}

.teaser {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.teaser img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
  filter: saturate(0.9);
  transition: filter 300ms ease;
}

.teaser:hover img { filter: saturate(1); }

.teaser figcaption {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teaser__name {
  font-family: var(--display);
  font-size: 18px;
  color: var(--ink);
}

.teaser__meta {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--stone);
}

@media (max-width: 800px) {
  .teaser-grid { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 800px) {
  .workshop-card { grid-template-columns: 1fr; gap: 28px; }
  .workshop-card__name { font-size: 32px; }
}

/* ============================================================
   Section: Projects
   ============================================================ */

.projects__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 16px;
}

.projects__grid--three {
  grid-template-columns: repeat(3, 1fr);
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-card__image {
  aspect-ratio: 4 / 5;
  background: var(--linen);
  position: relative;
  overflow: hidden;
}

.project-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms ease;
}

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

.project-card__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  filter: saturate(0.75) brightness(0.95);
}

.project-card__title {
  font-family: var(--display);
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

.project-card__meta {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0;
}

@media (max-width: 800px) {
  .projects__grid { grid-template-columns: 1fr 1fr; gap: 16px; }
}

/* ============================================================
   Section: Provenance
   ============================================================ */

.provenance {
  background: var(--ink);
  color: var(--paper);
}

.provenance__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
}

.provenance__split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 80px;
  align-items: center;
}

.provenance__copy {
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: flex-start;
}

.provenance__figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.provenance__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.provenance__figure figcaption {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(245, 241, 234, 0.55);
}

@media (max-width: 800px) {
  .provenance__split { grid-template-columns: 1fr; gap: 40px; }
}

.provenance__title {
  font-family: var(--display);
  font-size: clamp(28px, 3.5vw, 40px);
  line-height: 1.2;
  font-weight: 400;
  margin: 0;
  max-width: 22ch;
}

.provenance__body {
  font-size: 16px;
  line-height: 1.7;
  color: rgba(245, 241, 234, 0.75);
  margin: 0;
  max-width: 56ch;
}

.provenance .btn-text { color: var(--paper); border-bottom-color: var(--paper); }
.provenance .btn-text:hover { color: var(--saffron); border-bottom-color: var(--saffron); }

/* ============================================================
   Section: Trade
   ============================================================ */

.trade__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.trade__title {
  font-family: var(--display);
  font-size: clamp(32px, 4.5vw, 56px);
  line-height: 1.05;
  margin: 0;
  letter-spacing: -0.01em;
}

.trade__body { font-size: 17px; line-height: 1.6; max-width: 44ch; margin: 0 0 32px 0; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 32px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 240ms ease, transform 240ms ease;
}

.btn-primary:hover { background: var(--saffron); transform: translateY(-1px); }
.btn-primary::after { content: '→'; transition: transform 240ms ease; }
.btn-primary:hover::after { transform: translateX(4px); }

.trade__inner--with-image {
  grid-template-columns: 1fr 1.2fr;
  gap: 96px;
}

.trade__figure {
  margin: 0;
}

.trade__figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

@media (max-width: 800px) {
  .trade__inner { grid-template-columns: 1fr; gap: 32px; }
  .trade__inner--with-image { grid-template-columns: 1fr; }
  .trade__figure img { aspect-ratio: 3 / 2; }
}

/* ============================================================
   Footer
   ============================================================ */

.footer {
  background: var(--paper);
  border-top: 1px solid var(--hairline);
  padding: 80px 0 40px 0;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 80px;
}

.footer__lockup .wordmark {
  font-size: 28px;
  letter-spacing: 0.32em;
}

.footer__lockup__arabic {
  font-family: var(--arabic);
  font-size: 32px;
  margin-top: 8px;
  color: var(--ink);
  direction: rtl;
}

.footer__tagline {
  font-family: var(--display);
  font-size: 18px;
  margin-top: 16px;
  color: var(--stone);
}

.footer__pron {
  font-size: 12px;
  color: var(--stone);
  margin-top: 24px;
  font-style: italic;
  max-width: 30ch;
}

.footer__col h4 {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--stone);
  margin: 0 0 16px 0;
  font-weight: 500;
}

.footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 14px;
}

.footer__col a:hover { color: var(--saffron); }

.footer__bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 24px;
  border-top: 1px solid var(--hairline);
  font-size: 12px;
  color: var(--stone);
  letter-spacing: 0.02em;
}

@media (max-width: 800px) {
  .footer__top { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer__lockup { grid-column: 1 / -1; }
  .footer__bottom { flex-direction: column; gap: 8px; align-items: flex-start; }
}

/* ============================================================
   Reveal-on-scroll
   ============================================================ */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
