/* ══════════════════════════════════════════════════════════
   ALAWIYAH — site styles (v2, 5 Nov 2026)
   Tokens and type follow context/brand.md. Black on white, no
   accent, square corners, hairlines. All the warmth is in the
   photography.
   ══════════════════════════════════════════════════════════ */

:root {
  --ink: #000;
  --paper: #fff;
  --ink-soft: #3d3d3d;
  --muted: #757575;
  --line: rgba(0, 0, 0, 0.16);
  --line-soft: rgba(0, 0, 0, 0.1);
  --panel: rgba(239, 239, 239, 0.6);

  --font-display: "Cormorant Garamond", "Times New Roman", Georgia, serif;
  --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;

  --gutter: clamp(1rem, 5vw, 5.5rem);
  --max: 84rem;
  --nav-h: clamp(3.75rem, 8vh, 5rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --slow: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, 0.045) 1px, transparent 0);
  background-size: 26px 26px;
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--ink); color: var(--paper); }

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

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 0.75rem 1rem; font-size: 0.75rem; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

/* ── Type ─────────────────────────────────────────────── */
.label, .mono {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.875rem, 3.6vw, 3.125rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
  max-width: 20ch;
}
.title em, .statement em, .hero__title em, .begin__title em { font-style: italic; font-weight: 300; }
.body {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--ink-soft);
  max-width: 52ch;
}

/* ── Button ───────────────────────────────────────────── */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.6875rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1.05rem 2.4rem;
  border: 1px solid var(--ink);
  color: var(--ink);
  background: transparent;
  transition: background 0.45s var(--ease), color 0.45s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: transparent; color: var(--ink); }

/* ── Veil: the opening ────────────────────────────────── */
.veil { display: none; }
.js .veil {
  display: grid;
  place-items: center;
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--paper);
  transition: opacity 1.1s var(--ease), visibility 0s linear 1.1s;
}
.veil__mark {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  letter-spacing: 0.7em;
  text-indent: 0.7em;
  opacity: 0;
  animation: veil-mark 1.9s var(--slow) 0.15s forwards;
}
@keyframes veil-mark {
  from { opacity: 0; letter-spacing: 0.9em; text-indent: 0.9em; }
  to   { opacity: 1; letter-spacing: 0.5em; text-indent: 0.5em; }
}
.is-open .veil { opacity: 0; visibility: hidden; }
.no-veil .veil { display: none; }

/* ── Nav ──────────────────────────────────────────────── */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  padding-top: env(safe-area-inset-top);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(255, 255, 255, 0);
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease), border-color 0.5s var(--ease), transform 0.6s var(--ease);
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom-color: var(--line-soft);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav__mark {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 0.9375rem;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  text-decoration: none;
  line-height: 1;
}
.nav__link {
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  transition: color 0.3s var(--ease);
  width: max-content;
}
.nav__link:hover { color: var(--ink); }
.nav__link--right { justify-self: end; }

/* ── Hero ─────────────────────────────────────────────── */
.hero {
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--nav-h) + clamp(0.5rem, 3vh, 2rem)) var(--gutter) clamp(2rem, 6vh, 4rem);
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(1.75rem, 4.5vh, 3rem);
}
.hero__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 2.39;
  max-height: calc(100svh - var(--nav-h) - 15rem);
  min-height: 15rem;
  overflow: hidden;
  background: var(--panel);
}
.hero__frame img,
.hero__frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
}
.hero__frame video { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero__frame video.is-playing { opacity: 1; }
.js .hero__frame { clip-path: inset(6% 7% 6% 7%); opacity: 0; }
.js .hero__frame img { transform: scale(1.12); }
.is-open .hero__frame {
  clip-path: inset(0 0 0 0);
  opacity: 1;
  transition: clip-path 2.2s var(--slow), opacity 1.2s var(--ease);
}
.is-open .hero__frame img {
  transform: scale(1);
  transition: transform 16s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.hero__text {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
}
.hero__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(2.375rem, 5.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.015em;
}
.hero__aside { display: grid; gap: 1.25rem; justify-items: start; padding-bottom: 0.4rem; }
.hero__lede { color: var(--ink-soft); max-width: 44ch; line-height: 1.75; }
.js .hero__title,
.js .hero__aside { opacity: 0; transform: translateY(14px); }
.is-open .hero__title,
.is-open .hero__aside {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s var(--ease) 0.9s, transform 1.2s var(--ease) 0.9s;
}
.is-open .hero__aside { transition-delay: 1.1s; }

/* ── Sections ─────────────────────────────────────────── */
.section { padding: clamp(6rem, 16vh, 11rem) 0; }
.section--rule { padding-top: 0; }
.section--rule > .wrap::before {
  content: "";
  display: block;
  grid-column: 1 / -1;
  border-top: 1px solid var(--line);
  margin-bottom: clamp(6rem, 16vh, 11rem);
}
.head { display: grid; gap: 1.25rem; margin-bottom: clamp(3rem, 8vh, 5.5rem); }

/* 01 — What we make */
.statement {
  margin: 1.75rem 0 clamp(4rem, 10vh, 7rem);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.75rem, 3.3vw, 2.875rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  max-width: 30ch;
  text-wrap: pretty;
}
.statement em { color: var(--ink-soft); }
.trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3.5vw, 3.5rem);
}
.trio__item { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.trio__title {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.trio__item p { color: var(--ink-soft); max-width: 36ch; }

/* 02 — Method: the frame drawn across the model */
.method { position: relative; height: 260vh; }
.method__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-h);
}
.method__inner {
  display: grid;
  grid-template-columns: minmax(16rem, 1fr) 2.2fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
.method__text { display: grid; gap: 1.5rem; }
.method__title { font-size: clamp(1.75rem, 2.7vw, 2.625rem); max-width: 14ch; }
.compare {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--panel);
  --p: 0;
}
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__under { filter: grayscale(1) contrast(1.02); }
.compare__over {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--p) * 100%) 0 0);
}
.compare__rule {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(var(--p) * 100%);
  width: 1px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  opacity: calc(min(var(--p) * 40, 1) * min((1 - var(--p)) * 40, 1));
}
.compare__labels {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.1rem;
  color: var(--ink);
  pointer-events: none;
}
.compare__labels span:first-child { color: #fff; opacity: min(calc(var(--p) * 3), 1); }
.compare__labels span:last-child { opacity: max(calc(1 - var(--p) * 1.6), 0); }

/* 03 — The work */
.seq { display: grid; gap: clamp(4rem, 12vh, 8rem); }
.plate { display: grid; gap: 0.9rem; }
.plate__img { position: relative; overflow: hidden; background: var(--panel); }
.plate__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate3d(0, var(--shift, 0px), 0) scale(1.08);
  will-change: transform;
}
.plate--wide .plate__img { aspect-ratio: 16 / 9; }
.plate--tall .plate__img { aspect-ratio: 4 / 5; }
.plate--land .plate__img { aspect-ratio: 4 / 3; }
.plate--inset { width: 74%; margin-left: auto; }
.plate__cap { display: flex; justify-content: space-between; gap: 1rem; }
.plate__cap span:last-child { color: rgba(0, 0, 0, 0.38); }
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1rem, 5vw, 5rem);
  align-items: start;
}
.pair .plate--drop { margin-top: clamp(4rem, 16vh, 12rem); }
.pair--offset { grid-template-columns: 0.8fr 1.2fr; align-items: end; }

/* 04 — How it begins */
.steps { border-top: 1px solid var(--line); }
.step {
  display: grid;
  grid-template-columns: 4rem minmax(12rem, 1fr) 1.5fr minmax(15rem, 0.8fr);
  gap: clamp(1rem, 3vw, 3rem);
  align-items: baseline;
  padding: clamp(1.75rem, 4vh, 2.5rem) 0;
  border-bottom: 1px solid var(--line);
}
.step__n {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 1.125rem;
  color: var(--muted);
}
.step__name {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 2.4vw, 2.125rem);
  line-height: 1.1;
}
.step__body { color: var(--ink-soft); max-width: 46ch; }
.step__meta { justify-self: end; text-align: right; }
.promise {
  margin-top: clamp(3rem, 8vh, 5rem);
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.25rem, 2vw, 1.625rem);
  line-height: 1.4;
  color: var(--ink-soft);
  max-width: 34ch;
  text-wrap: balance;
}

/* 05 — Studio */
.studio {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
}
.studio__head { display: grid; gap: 1.5rem; }
.studio__text { display: grid; gap: 1.25rem; padding-bottom: 0.4rem; }

/* 06 — Begin */
.begin {
  min-height: 92vh;
  min-height: 92svh;
  display: grid;
  place-items: center;
  border-top: 1px solid var(--line-soft);
  padding: clamp(6rem, 14vh, 9rem) 0;
  text-align: center;
}
.begin__inner { display: grid; justify-items: center; gap: 1.75rem; }
.begin__title {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2.5rem, 6vw, 5.25rem);
  line-height: 1;
  letter-spacing: -0.015em;
}
.begin__lede { text-align: center; max-width: 40ch; margin-bottom: 0.75rem; }
.begin__mail {
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.begin__mail:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* Footer */
.foot { border-top: 1px solid var(--line-soft); }
.foot__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
}

/* ── Reveal ───────────────────────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ── Tablet ───────────────────────────────────────────── */
@media (max-width: 960px) {
  .hero__text { grid-template-columns: 1fr; align-items: start; }
  .trio { grid-template-columns: 1fr; gap: 2.25rem; }
  .method { height: 220vh; }
  .method__inner { grid-template-columns: 1fr; gap: 2rem; }
  .step { grid-template-columns: 2.5rem 1fr; row-gap: 0.75rem; }
  .step__body, .step__meta { grid-column: 2; }
  .step__meta { justify-self: start; text-align: left; }
  .studio { grid-template-columns: 1fr; align-items: start; }
}

/* ── Phone ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav { grid-template-columns: auto 1fr; }
  .nav__link--left { display: none; }
  .nav__mark { letter-spacing: 0.32em; text-indent: 0; font-size: 0.875rem; }
  .hero { justify-content: flex-end; gap: 1.75rem; }
  .hero__frame { aspect-ratio: 4 / 5; max-height: 62svh; }
  .hero__frame img { object-position: 30% 50%; }
  .plate--inset { width: 100%; }
  .pair, .pair--offset { grid-template-columns: 1fr; gap: clamp(4rem, 12vh, 6rem); }
  .pair .plate--drop { margin-top: 0; }
  .method__sticky { align-items: center; }
  .foot__inner { flex-direction: column; gap: 0.4rem; }
}

/* ── Reduced motion ───────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .veil { display: none; }
  .js .hero__frame, .is-open .hero__frame { clip-path: none; opacity: 1; transition: none; }
  .js .hero__frame img, .is-open .hero__frame img { transform: none; transition: none; }
  .js .hero__title, .js .hero__aside, .js .reveal { opacity: 1; transform: none; transition: none; }
  .plate__img img { transform: none; }
  .method { height: auto; }
  .method__sticky { position: static; height: auto; padding: clamp(6rem, 16vh, 11rem) 0; }
  .compare { --p: 0.5 !important; }
}
