/* edits.by.gufran — brand tokens (see the identity board) */
:root {
  --teal: #072D33;
  --wine: #33091B;
  --green: #3A7564;
  --sage: #9ABCAB;
  --mauve: #8F5C64;
  --gold: #DFBE8B;
  --linen: #F4ECDF;
  --linen-2: #EADFCB;
  --paper: #FBF7F0;
  --muted: #4D5F5F;
  --line: #DCCFB9;

  /* La Gagliane needs a commercial web license before this site goes live.
     Until then it shows only where it is installed; Amiri is the fallback. */
  --display: "La Gagliane", "Amiri", serif;
  --serif: "Amiri", serif;
  --sans: "Jost", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--linen);
  background-image:
    repeating-linear-gradient(0deg, rgba(7, 45, 51, 0.028) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(7, 45, 51, 0.02) 0 1px, transparent 1px 4px);
  color: var(--teal);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* Arabic: Amiri everywhere (La Gagliane and Jost have no Arabic) */
html[lang="ar"] body { font-family: var(--serif); font-size: 19px; }
html[lang="ar"] h1, html[lang="ar"] h2 { font-family: var(--serif); font-weight: 700; letter-spacing: 0; }
html[lang="ar"] .eyebrow, html[lang="ar"] .logo-top, html[lang="ar"] .reel-label { letter-spacing: 0; text-transform: none; }

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

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

.eyebrow {
  font-family: var(--sans); font-weight: 500; font-size: 13px;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--mauve);
  margin-bottom: 22px;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--linen) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 76px; }
.logo { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.logo-top { font-size: 10px; font-weight: 500; letter-spacing: 0.4em; text-transform: uppercase; color: var(--mauve); margin-bottom: 12px; }
.logo-name { font-family: var(--display); font-size: 30px; line-height: 1.1; }
html[lang="ar"] .logo-name { font-family: var(--serif); font-weight: 700; font-size: 26px; }
.nav { display: flex; gap: 26px; margin-inline-start: auto; font-size: 15px; color: var(--muted); }
.nav a:hover { color: var(--teal); }
.lang-toggle {
  font: inherit; font-size: 14px; cursor: pointer;
  background: transparent; color: var(--teal);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px;
}
.lang-toggle:hover { border-color: var(--teal); }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero-inner { position: relative; padding-top: 104px; padding-bottom: 64px; text-align: center; display: flex; flex-direction: column; align-items: center; }
h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(44px, 7vw, 88px); line-height: 1.12; letter-spacing: -0.01em;
  max-width: 14ch;
}
html[lang="ar"] h1 { line-height: 1.4; }
.lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 20px); max-width: 52ch; margin-top: 26px; }
.hero-actions { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; justify-content: center; }

.vine { position: absolute; pointer-events: none; z-index: 0; }
.vine-tl { top: 0; left: 0; width: min(46vw, 520px); height: 380px; }
.vine-br { top: 300px; right: 0; width: min(40vw, 460px); height: 420px; }
html[dir="rtl"] .vine-tl { left: auto; right: 0; transform: scaleX(-1); }
html[dir="rtl"] .vine-br { right: auto; left: 0; transform: scaleX(-1); }
.hero-inner > * { position: relative; z-index: 1; }

.btn { display: inline-block; padding: 13px 26px; border-radius: 999px; font-weight: 500; font-size: 15px; transition: transform .15s, background .15s; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--green); color: var(--linen); }
.btn-primary:hover { background: var(--teal); }
.btn-ghost { border: 1px solid var(--teal); }
.btn-ghost:hover { background: var(--teal); color: var(--linen); }

/* Lace frames are drawn by ornaments.js into svg.lace */
[data-lace] { position: relative; }
svg.lace { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 10px 18px rgba(7, 45, 51, 0.10)); }

/* Reel */
.reel { width: 100%; margin-top: 64px; aspect-ratio: 16 / 9; }
.reel-inner, .thumb-inner {
  position: absolute; inset: 7%; background: var(--linen-2);
  display: grid; place-items: center;
}
.reel-inner iframe, .reel-inner video { width: 100%; height: 100%; display: block; border: 0; }
.play {
  width: 84px; height: 84px; border-radius: 50%; background: var(--green); position: relative;
  box-shadow: 0 8px 22px rgba(7, 45, 51, 0.18);
}
.play::after {
  content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent var(--linen);
}
.reel-label { position: absolute; bottom: 18px; inset-inline-start: 22px; font-size: 13px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--muted); }

/* Sections */
.section { padding-top: 112px; }
.section-head { margin-bottom: 40px; }
h2 { font-family: var(--display); font-weight: 400; font-size: clamp(36px, 4.4vw, 56px); line-height: 1.15; }
.section-head p:not(.eyebrow) { color: var(--muted); margin-top: 12px; }

/* Work grid */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px; }
.card { display: block; }
.thumb { aspect-ratio: 4 / 5; transition: transform .25s; }
.card:hover .thumb { transform: translateY(-4px); }
.thumb-inner { inset: 9%; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.card-body { padding-top: 18px; }
.card-body h3 { font-family: var(--serif); font-size: 26px; font-weight: 700; line-height: 1.2; }
.card-body p { color: var(--muted); font-size: 15px; margin-top: 2px; }

/* Services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.service { border-top: 1px solid var(--line); padding-top: 22px; }
.service .num { color: var(--mauve); font-weight: 500; font-size: 14px; letter-spacing: 0.2em; }
.service h3 { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 8px 0 6px; }
.service p { color: var(--muted); font-size: 15px; }
.tools { margin-top: 34px; color: var(--muted); font-size: 15px; }
.tools span { color: var(--teal); font-weight: 600; }

/* About */
.about p:not(.eyebrow) { max-width: 60ch; font-family: var(--serif); font-size: 24px; line-height: 1.55; }
.about p + p { margin-top: 12px; color: var(--muted); font-family: var(--sans); font-size: 16px; }

/* Contact: deep teal with the gold dot motif */
.contact { position: relative; margin-top: 120px; background: var(--teal); color: var(--linen); overflow: hidden; }
.contact .dots { position: absolute; inset: 0; width: 100%; height: 100%; }
.contact-inner { position: relative; padding-top: 104px; padding-bottom: 104px; text-align: center; }
.contact h2 { color: var(--linen); }
.contact p { color: var(--sage); margin-top: 30px; }
.email { display: inline-block; margin-top: 28px; font-family: var(--serif); font-style: italic; font-size: clamp(26px, 4vw, 44px); border-bottom: 1px solid var(--gold); direction: ltr; }
.email:hover { color: var(--gold); }
.links { display: flex; gap: 26px; margin-top: 30px; justify-content: center; color: var(--gold); font-size: 14px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.links a:hover { color: var(--linen); }
.num-ltr { direction: ltr; unicode-bidi: isolate; letter-spacing: 0.08em; margin-inline-start: 6px; color: var(--linen); }

/* Footer */
.site-footer { display: flex; justify-content: space-between; gap: 16px; padding-top: 26px; padding-bottom: 34px; color: var(--muted); font-size: 14px; }

/* Case study page */
.cs-hero { padding-top: 76px; }
.back { color: var(--muted); font-size: 15px; }
.back:hover { color: var(--teal); }
.cs-hero h1 { margin-top: 26px; max-width: none; line-height: 1.3; }
.meta { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 38px; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta dt { color: var(--mauve); font-size: 12px; font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; }
.meta dd { font-family: var(--serif); font-size: 20px; font-weight: 700; }
.cs-block { padding-top: 64px; max-width: 760px; }
.cs-block h2 { font-size: 36px; margin-bottom: 12px; }
.cs-block p { color: #2f4444; }
.frames { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 64px; }
.frames .thumb { aspect-ratio: 4 / 3; }
.cs-hero .reel { margin-top: 48px; }

/* Mobile */
@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .nav { display: none; }
  .lang-toggle { margin-inline-start: auto; }
  .hero-inner { padding-top: 72px; }
  .vine-tl { width: 62vw; height: 230px; }
  .vine-br { top: 360px; width: 52vw; height: 260px; }
  .grid, .services { grid-template-columns: 1fr; }
  .section { padding-top: 84px; }
  .meta { grid-template-columns: repeat(2, 1fr); }
  .frames { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
  .links { flex-wrap: wrap; }
  .play { width: 58px; height: 58px; }
  .play::after { border-width: 10px 0 10px 16px; }
  .reel-label { bottom: 10px; font-size: 11px; }
}

/* Before / After pair: titles above the videos, videos keep their full 9:16 frame */
.card-wide { grid-column: 1 / -1; }
.ba { padding: clamp(56px, 6vw, 80px) clamp(36px, 6vw, 80px); }
.ba-inner { position: relative; z-index: 1; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 3vw, 28px); }
.ba-col { flex: 0 1 340px; width: min(100%, 340px); display: flex; flex-direction: column; gap: 14px; }
.ba-title { font-family: "La Gagliane", "Amiri", serif; font-weight: 400; font-size: clamp(34px, 4vw, 48px); line-height: 1; text-align: center; color: var(--teal); }
.ba-pane { position: relative; width: 100%; aspect-ratio: 9 / 16; background: var(--teal); overflow: hidden; }
.ba-pane video { width: 100%; height: 100%; object-fit: contain; display: block; background: var(--teal); }
@media (max-width: 760px) {
  .ba { padding: 58px 38px; }
  .ba-inner { flex-wrap: nowrap; gap: 10px; }
  .ba-col { flex: 1 1 0; width: auto; min-width: 0; gap: 10px; }
  .ba-title { font-size: 30px; }
}

/* Work heading: one large word */
.work-title { font-size: clamp(64px, 10vw, 128px); line-height: 1.05; }
html[lang="ar"] .work-title { font-family: var(--serif); font-weight: 700; line-height: 1.3; }

/* Before / After slider: videos sit side by side per slide, swipe or arrows move between slides */
.grid > .card, .ba { min-width: 0; }
.ba-track {
  position: relative; z-index: 1; min-width: 0; max-width: 100%; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ba-track::-webkit-scrollbar { display: none; }
.ba-track:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.ba-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; }
.ba-nav {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  width: 38px; height: 38px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 92%, transparent); color: var(--teal);
  transition: background .15s, opacity .15s;
}
.ba-nav::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 9px; height: 9px;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
}
.ba-prev { left: 4px; }
.ba-next { right: 4px; }
.ba-prev::before { transform: translate(-30%, -50%) rotate(-135deg); }
.ba-next::before { transform: translate(-70%, -50%) rotate(45deg); }
.ba-nav:hover:not(:disabled) { background: var(--paper); }
.ba-nav:disabled { opacity: 0.3; cursor: default; }
.ba-nav:focus-visible, .ba-dot:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ba-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ba-caps { min-width: 0; }
.ba-dots { display: flex; gap: 2px; padding-top: 8px; flex: none; }
.ba-dot { position: relative; width: 26px; height: 26px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.ba-dot::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 11px; height: 11px; transform: translate(-50%, -50%);
  border: 1.5px solid var(--teal); border-radius: 50%; background: transparent; transition: background .15s;
}
.ba-dot[aria-current="true"]::before { background: var(--teal); }
@media (hover: none), (max-width: 760px) { .ba-nav { display: none; } }
@media (prefers-reduced-motion: reduce) { .ba-track { scroll-behavior: auto; } }

/* Download progress while a video is being fetched (Safari / iPhone) */
.ba-load {
  position: absolute; top: 50%; left: 50%; z-index: 2; transform: translate(-50%, -50%);
  padding: 6px 16px; border-radius: 999px; pointer-events: none;
  background: color-mix(in srgb, var(--teal) 80%, transparent); color: var(--linen);
  font: 500 15px/1.2 var(--sans); letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
}


/* Work card that plays its video in place */
.thumb-media { overflow: hidden; background: var(--teal); }
.thumb-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: var(--teal); }
