/* Cairo AI Studio v1 — Direction 3 "The Colour Cast" (identity/DIRECTIONS.md).
   Paper + ink, eight cast colours, Fraunces / Archivo Narrow / Aref Ruqaa.
   No inline styles anywhere (strict CSP): every colour and size lives here as a token. */

:root {
  /* colour */
  --paper: #F3EEE4;
  --paper-hi: #FBF8F1;
  --ink: #1F1D1B;
  --ink-2: #4A4540;
  --rule: #CFC6B6;
  --error: #6B1E2B;
  --ochre: #B5832E;
  --olive: #6B6A3A;
  --terracotta: #B4472C;
  --black: #1F1D1B;
  --burgundy: #6B1E2B;
  --sand: #C9B79A;
  --bottle: #2F4A3A;
  --slate: #4A4E4F;

  /* type */
  --f-display: "Fraunces", Georgia, "Times New Roman", serif;
  --f-label: "Archivo Narrow", "Arial Narrow", Arial, sans-serif;
  --f-ar: "Aref Ruqaa", "Times New Roman", serif;
  --t-xs: 0.75rem;
  --t-sm: 0.875rem;
  --t-md: 1.0625rem;
  --t-lg: clamp(1.25rem, 1.05rem + 0.8vw, 1.5rem);
  --t-xl: clamp(1.75rem, 1.3rem + 1.9vw, 2.75rem);
  --t-2xl: clamp(2.25rem, 1.4rem + 3.6vw, 4.5rem);
  --t-mark: clamp(4rem, 19vw, 8rem);

  /* space */
  --s1: 0.25rem;
  --s2: 0.5rem;
  --s3: 0.75rem;
  --s4: 1rem;
  --s5: 1.5rem;
  --s6: 2rem;
  --s7: 3rem;
  --s8: 4.5rem;
  --s9: 7rem;
  --gutter: 1rem;
  --max: 84rem;

  /* misc */
  --radius: 2px;
  --line: 1.5px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --tilt: 3deg;
}

@media (min-width: 40rem) { :root { --gutter: 2rem; } }
@media (min-width: 64rem) { :root { --gutter: 3rem; } }

/* cast colour sets: --c = the colour, --on = readable text on it */
.c-lola    { --c: var(--ochre);      --on: var(--ink); }
.c-maria   { --c: var(--olive);      --on: var(--paper); }
.c-zizo    { --c: var(--terracotta); --on: var(--paper); }
.c-tarek   { --c: var(--black);      --on: var(--paper); }
.c-malak   { --c: var(--burgundy);   --on: var(--paper); }
.c-farida  { --c: var(--sand);       --on: var(--ink); }
.c-rania   { --c: var(--bottle);     --on: var(--paper); }
.c-sherif  { --c: var(--slate);      --on: var(--paper); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-display);
  font-size: var(--t-md);
  line-height: 1.55;
  font-optical-sizing: auto;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip {
  position: absolute; left: var(--s4); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: var(--s3) var(--s4);
  font-family: var(--f-label); font-weight: 600; text-decoration: none;
}
.skip:focus { top: var(--s4); }

.kicker {
  font-family: var(--f-label); font-size: var(--t-sm); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
}

.note {
  font-family: var(--f-ar); font-size: var(--t-lg); color: var(--terracotta);
  line-height: 1.3; transform: rotate(-2deg);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem;
  padding: var(--s3) var(--s5); border: var(--line) solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper); cursor: pointer;
  font-family: var(--f-label); font-size: var(--t-md); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; text-decoration: none;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.btn:hover { background: var(--ochre); color: var(--ink); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s4);
  max-width: var(--max); margin: 0 auto; padding: var(--s4) var(--gutter);
}
.brand { display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; min-height: 2.75rem; }
.brand__mark { width: 2.25rem; height: 2.25rem; }
.brand__name {
  font-family: var(--f-label); font-weight: 700; font-size: var(--t-sm);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.top__nav ul { display: flex; gap: var(--s4); }
.top__nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-family: var(--f-label); font-size: var(--t-sm); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none;
}
.top__nav a:hover { text-decoration: underline; }
@media (max-width: 29.99rem) { .brand__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
@media (min-width: 64rem) { .top__nav ul { gap: var(--s6); } }

/* ---------- frames, placeholders, AI garment label ---------- */
.frame { position: relative; }
.frame__pic { position: relative; overflow: hidden; background: var(--c, var(--sand)); }
.frame--portrait .frame__pic { aspect-ratio: 2 / 3; }
.frame--wide .frame__pic,
.frame--hero .frame__pic { aspect-ratio: 3 / 2; }
.frame__pic img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.7s var(--ease);
}
.frame.is-loaded .frame__pic img { opacity: 1; }

.ph {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  gap: var(--s1); padding: var(--s4);
  color: var(--on, var(--ink));
  background:
    repeating-linear-gradient(135deg, rgb(0 0 0 / 0.06) 0 2px, transparent 2px 14px),
    var(--c, var(--sand));
}
.ph__obj { font-family: var(--f-display); font-size: var(--t-lg); font-weight: 600; line-height: 1.15; }
.ph__note {
  font-family: var(--f-label); font-size: var(--t-xs); font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.ph--cast,
.ph--stripes {
  color: var(--paper);
  background: linear-gradient(90deg,
    var(--ochre) 0 12.5%, var(--olive) 12.5% 25%, var(--terracotta) 25% 37.5%, var(--black) 37.5% 50%,
    var(--burgundy) 50% 62.5%, var(--sand) 62.5% 75%, var(--bottle) 75% 87.5%, var(--slate) 87.5% 100%);
}
.ph--cast .ph__obj, .ph--cast .ph__note,
.ph--stripes .ph__obj, .ph--stripes .ph__note {
  align-self: flex-start; background: var(--ink); padding: var(--s1) var(--s2);
}
.ph--paper { color: var(--ink); background: repeating-linear-gradient(135deg, rgb(0 0 0 / 0.05) 0 2px, transparent 2px 14px), var(--paper-hi); }
.frame.is-loaded .ph { visibility: hidden; }

/* The "AI" garment label: HTML text on every character image, never painted in. */
.ai-tag {
  position: absolute; top: var(--s3); left: var(--s3); z-index: 2;
  max-width: calc(100% - 1.5rem);
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 0.3rem 0.6rem 0.3rem 0.5rem;
  background: var(--paper-hi); color: var(--ink);
  border: 1px solid var(--ink); border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.25);
  font-family: var(--f-label); font-size: var(--t-xs); font-weight: 600; line-height: 1.25;
  letter-spacing: 0.06em; text-transform: uppercase;
  transform: rotate(calc(var(--tilt) * -0.66));
  transform-origin: left top;
}
.ai-tag::before {
  content: ""; flex: none; width: 0.45rem; height: 0.45rem;
  border: 1.5px solid var(--ink); border-radius: 50%;
}

/* ---------- 1. hero ---------- */
.hero {
  position: relative;
  display: grid; gap: var(--s5);
  grid-template-areas: "mark" "copy" "media";
  max-width: var(--max); margin: 0 auto;
  padding: var(--s5) var(--gutter) var(--s7);
}
.wordmark {
  grid-area: mark;
  display: flex; flex-direction: column; align-items: flex-start;
  font-family: var(--f-display); font-size: var(--t-mark); font-weight: 900;
  font-variation-settings: "SOFT" 100, "opsz" 144;
  line-height: 0.84; letter-spacing: -0.02em; text-transform: uppercase;
}
.wordmark__label {
  display: inline-block; margin: 0.06em 0 0.08em 0.04em;
  padding: 0.04em 0.22em 0.08em 0.16em;
  font-size: 0.78em;
  background: var(--paper-hi); border: 3px solid var(--ink); border-radius: 3px;
  box-shadow: 0.05em 0.06em 0 var(--ink);
  transform: rotate(var(--tilt)); transform-origin: left center;
  position: relative;
}
.wordmark__label::after {
  content: ""; position: absolute; right: 0.08em; top: 50%;
  width: 0.09em; height: 0.09em; margin-top: -0.045em;
  border: 3px solid var(--ink); border-radius: 50%;
}
.hero__copy { grid-area: copy; display: grid; gap: var(--s4); justify-items: start; max-width: 34rem; }
.hero__line {
  font-size: var(--t-xl); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 100;
}
.hero__sub { color: var(--ink-2); max-width: 30rem; }
.frame--hero { grid-area: media; }
.frame__pic--torn {
  clip-path: polygon(0 0, 100% 0, 100% 96.4%, 97% 98.6%, 94% 96.8%, 90.5% 99%, 86% 97.1%, 82% 98.8%, 77.5% 96.5%,
    73% 99.2%, 68% 97.3%, 63.5% 98.9%, 58.5% 96.6%, 53.5% 99%, 48.5% 97.2%, 43.5% 98.7%, 38.5% 96.4%, 33.5% 99.1%,
    28.5% 97%, 23.5% 98.8%, 18.5% 96.7%, 13.5% 99%, 8.5% 97.2%, 4% 98.8%, 0 96.9%);
}
.note--hero { position: absolute; right: var(--gutter); bottom: var(--s4); }

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: "mark media" "copy media";
    grid-template-rows: auto 1fr;
    column-gap: var(--s7); row-gap: var(--s6);
    align-items: start;
    padding-top: var(--s6);
  }
  .wordmark { font-size: min(var(--t-mark), 8.75vw); }
  .frame--hero { align-self: center; transform: rotate(-0.6deg); }
  .note--hero { bottom: var(--s5); }
}

.swatches { display: grid; grid-template-columns: repeat(8, 1fr); height: 0.75rem; }
.swatches span { background: var(--c); }

/* ---------- sections ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: var(--s8) var(--gutter); }
.section__head { display: grid; gap: var(--s3); max-width: 44rem; margin-bottom: var(--s6); }
.section__head h2, .audit h2 {
  font-size: var(--t-2xl); font-weight: 800; line-height: 1; letter-spacing: -0.02em;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.section__intro { color: var(--ink-2); max-width: 38rem; }
.section__head .note { justify-self: start; margin-top: var(--s2); }
@media (min-width: 64rem) { .section { padding-top: var(--s9); padding-bottom: var(--s9); } }

/* ---------- 2. the cast ---------- */
.cast-grid { display: grid; gap: var(--s3); }
.cast-card {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 14fr);
  background: var(--c); color: var(--on);
}
.cast-card__text { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4) var(--s4) var(--s5); }
.cast-card h3 {
  font-size: var(--t-xl); font-weight: 700; line-height: 1;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.cast-card .role {
  font-family: var(--f-label); font-size: var(--t-sm); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.cast-card .line { font-size: var(--t-md); line-height: 1.4; }
.cast-card .frame__pic { background: var(--c); }
.cast-card .ph { background: repeating-linear-gradient(135deg, rgb(0 0 0 / 0.1) 0 2px, transparent 2px 14px), var(--c); }

@media (min-width: 40rem) {
  .cast-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
  .cast-card { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}
@media (min-width: 64rem) {
  .cast-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
  .cast-card:nth-child(even) { transform: translateY(var(--s6)); }
  .cast { padding-bottom: calc(var(--s9) + var(--s6)); }
}

/* ---------- 3. services ---------- */
.service-list { border-top: var(--line) solid var(--ink); }
.service {
  display: grid; gap: var(--s2);
  padding: var(--s5) 0; border-bottom: 1px solid var(--rule);
}
.service__lead {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--f-label); font-size: var(--t-sm); font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2);
}
.chip { width: 1rem; height: 1rem; flex: none; background: var(--c); border: 1px solid rgb(0 0 0 / 0.2); }
.service h3 {
  font-size: var(--t-xl); font-weight: 600; line-height: 1.05; letter-spacing: -0.01em;
  font-variation-settings: "SOFT" 100;
}
.service p:last-child { max-width: 36rem; }
@media (min-width: 60rem) {
  .service {
    grid-template-columns: minmax(0, 3fr) minmax(0, 5fr) minmax(0, 5fr);
    column-gap: var(--s6); align-items: baseline; padding: var(--s6) 0;
  }
}

/* ---------- 4. process ---------- */
.process { border-top: var(--line) solid var(--ink); }
.steps { display: grid; gap: var(--s5); counter-reset: none; }
.step { display: grid; gap: var(--s2); padding-top: var(--s4); border-top: 1px solid var(--rule); }
.step__no { font-family: var(--f-label); font-size: var(--t-sm); font-weight: 700; letter-spacing: 0.14em; color: var(--ink-2); }
.step h3 {
  font-size: var(--t-2xl); font-weight: 300; font-style: italic; line-height: 1;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.process__pics { display: grid; gap: var(--s4); margin-top: var(--s7); }
@media (min-width: 40rem) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); } }
@media (min-width: 64rem) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .process__pics { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: end; }
  .frame--small { transform: rotate(1.2deg) translateY(calc(var(--s6) * -1)); }
}

/* ---------- 5. audit ---------- */
.audit {
  max-width: none;
  /* downtown Cairo light through shutters, on Lola's ochre */
  background:
    repeating-linear-gradient(115deg, rgb(255 255 255 / 0.09) 0 3rem, transparent 3rem 7rem),
    var(--ochre);
  color: var(--ink);
}
.audit .kicker, .audit .section__intro { color: var(--ink); }
.audit .note { color: var(--ink); }
.audit__inner {
  max-width: var(--max); margin: 0 auto;
  display: grid; gap: var(--s6);
  grid-template-areas: "text" "form" "pic";
}
.audit__text { grid-area: text; display: grid; gap: var(--s3); align-content: start; }
.audit__text .note { justify-self: start; }
.sheet { grid-area: form; }
.frame--audit { grid-area: pic; }
.frame--audit .frame__pic { aspect-ratio: 4 / 5; }
.frame--audit img { object-position: 50% 15%; }
@media (min-width: 64rem) {
  .audit__inner {
    grid-template-columns: minmax(0, 4fr) minmax(0, 5fr);
    grid-template-areas: "text form" "pic form";
    column-gap: var(--s8); row-gap: var(--s6); align-items: start;
  }
  .frame--audit { max-width: 26rem; transform: rotate(-1.2deg); }
  .frame--audit .frame__pic { aspect-ratio: 2 / 3; }
}

.sheet {
  display: grid; gap: var(--s4);
  background: var(--paper); color: var(--ink);
  padding: var(--s5) var(--s4);
  box-shadow: 0.4rem 0.5rem 0 var(--ink);
}
@media (min-width: 40rem) { .sheet { padding: var(--s6); } }
.sheet__hint { font-size: var(--t-sm); color: var(--ink-2); }
.field { display: grid; gap: var(--s1); }
.field label {
  font-family: var(--f-label); font-size: var(--t-sm); font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 3rem; padding: var(--s3);
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--paper-hi); border: var(--line) solid var(--ink); border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 6rem; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 1.25rem) 55%, calc(100% - 0.85rem) 55%; background-size: 0.4rem 0.4rem; background-repeat: no-repeat; padding-right: 2.5rem; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline-offset: 1px; }
.field [aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.field__hint { font-size: var(--t-sm); color: var(--ink-2); }
.field__error { font-family: var(--f-label); font-size: var(--t-sm); font-weight: 700; color: var(--error); }
.field__error:empty { display: none; }
.sheet__status { font-size: var(--t-sm); }
.sheet__status:empty { display: none; }
.sheet__status.is-ok { border-left: 4px solid var(--bottle); padding-left: var(--s3); }
.sheet__status.is-error { border-left: 4px solid var(--error); padding-left: var(--s3); color: var(--error); font-weight: 600; }
.sheet__fallback, .sheet__plain a { font-weight: 600; }
.sheet__fallback { display: inline-flex; align-items: center; min-height: 2.75rem; }
.sheet__plain { padding-top: var(--s3); border-top: 1px solid var(--rule); }
.sheet__plain a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* ---------- 6. footer ---------- */
.foot { background: var(--ink); color: var(--paper); }
.foot :focus-visible { outline-color: var(--paper); }
.foot__inner {
  max-width: var(--max); margin: 0 auto; padding: var(--s8) var(--gutter) var(--s7);
  display: grid; gap: var(--s6);
}
.foot__mark {
  display: flex; flex-direction: column; align-items: flex-start;
  font-size: clamp(2.5rem, 10vw, 4.5rem); font-weight: 900; line-height: 0.86; text-transform: uppercase;
  font-variation-settings: "SOFT" 100, "opsz" 144;
}
.foot__label {
  margin: 0.06em 0; padding: 0 0.18em; font-size: 0.78em;
  background: var(--paper); color: var(--ink); border-radius: 2px;
  transform: rotate(var(--tilt)); transform-origin: left center;
}
.foot__text { display: grid; gap: var(--s4); max-width: 40rem; }
.foot__line { font-size: var(--t-xl); font-weight: 600; line-height: 1.1; font-variation-settings: "SOFT" 100; }
.foot__honest { color: var(--paper); }
.foot__links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }
.foot__links a {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-family: var(--f-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.foot__small { font-family: var(--f-label); font-size: var(--t-sm); color: var(--sand); }
@media (min-width: 60rem) { .foot__inner { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: var(--s8); } }

/* ---------- motion (subtle, editorial; off for reduced motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .wordmark__line, .hero__copy { animation: rise 0.8s var(--ease) both; }
  .wordmark__line:last-child { animation-delay: 0.16s; }
  .hero__copy { animation-delay: 0.28s; }
  .wordmark__label { animation: stitch 0.9s var(--ease) 0.08s both; }
  @keyframes rise { from { opacity: 0; transform: translateY(0.6rem); } to { opacity: 1; transform: none; } }
  @keyframes stitch { from { opacity: 0; transform: rotate(-4deg) translateY(-0.2em); } to { opacity: 1; transform: rotate(var(--tilt)); } }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame__pic img, .btn { transition: none; }
}
