/* Fraytees Consulting: shared styles for frayteesconsulting.com
   Layout: reads like a well-made field report. A wide text column, a fact box
   beside the opening, full-width bands between sections, one map as the
   centrepiece. Teal for the sea coast, ochre for the desert interior. */

:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --band: #e6eeec;
  --ink: #12282e;
  --muted: #52666b;
  --line: #d3dedb;
  --accent: #0a676b;
  --accent-strong: #074e52;
  --on-accent: #ffffff;
  --ochre: #965800;
  --ochre-soft: #f4e7d0;
  --map-land: #cfe0dc;
  --map-neighbour: #e3ebe9;
  --map-stroke: #9bb7b1;

  --font-display: "Readex Pro", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "IBM Plex Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.55rem;
  --step-3: clamp(1.7rem, 3vw, 2.15rem);
  --step-4: clamp(2.1rem, 5vw, 3.3rem);

  --measure: 66ch;
  --wrap: 1160px;
  --radius: 10px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d191c;
    --surface: #132327;
    --band: #102024;
    --ink: #e2ecea;
    --muted: #9bb0b1;
    --line: #25393d;
    --accent: #52bcb5;
    --accent-strong: #7fd3cd;
    --on-accent: #062220;
    --ochre: #e4a64a;
    --ochre-soft: #33280f;
    --map-land: #24403f;
    --map-neighbour: #172a2d;
    --map-stroke: #3d5e5d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d191c;
  --surface: #132327;
  --band: #102024;
  --ink: #e2ecea;
  --muted: #9bb0b1;
  --line: #25393d;
  --accent: #52bcb5;
  --accent-strong: #7fd3cd;
  --on-accent: #062220;
  --ochre: #e4a64a;
  --ochre-soft: #33280f;
  --map-land: #24403f;
  --map-neighbour: #172a2d;
  --map-stroke: #3d5e5d;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--surface);
}

img, svg { max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.3; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: var(--step-1); line-height: 1.55; color: var(--ink); max-width: 40em; }
.muted { color: var(--muted); }
.skip { position: absolute; top: 0; inset-inline-start: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; top: 12px; inset-inline-start: 16px; z-index: 30; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; gap: 24px; padding-block: 14px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-inline-end: auto; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; line-height: 1.1; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 0.74rem; color: var(--muted); letter-spacing: 0.02em; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { color: var(--ink); text-decoration: none; font-size: 0.97rem; }
.site-nav a:hover { color: var(--accent); }
.site-nav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
.lang-link { font-family: var(--font-display); font-size: 1rem !important; border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; }
.menu-btn { display: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 1rem/1.2 var(--font-body);
  padding: 13px 20px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--band); }
.btn-small { padding: 8px 14px; font-size: 0.92rem; }

@media (max-width: 860px) {
  .menu-btn {
    display: inline-flex;
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: 500 0.95rem var(--font-body);
    padding: 8px 12px;
    cursor: pointer;
  }
  .site-nav {
    display: none;
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter-r) 16px var(--gutter-l);
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .site-nav .lang-link { align-self: flex-start; margin-top: 12px; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 12px; }
}

/* Sections */
.section { padding-block: clamp(56px, 8vw, 96px); }
.section-band { background: var(--band); }
.section-head { display: grid; gap: 12px; margin-bottom: 36px; max-width: 46em; }
.section-head p { color: var(--muted); }

/* Hero */
.hero { padding-block: clamp(40px, 7vw, 84px) clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.hero h1 em { font-style: normal; color: var(--accent); }

.factbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  min-width: 0;
}
.factbox-title { font-family: var(--font-mono); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.facts { list-style: none; display: grid; }
.facts li { display: grid; grid-template-columns: 5.2rem 1fr; gap: 14px; align-items: baseline; padding-block: 13px; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; padding-bottom: 2px; }
.fact-num { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; line-height: 1; color: var(--ochre); font-variant-numeric: tabular-nums; }
.fact-text { font-size: 0.97rem; line-height: 1.4; }

.client-strip { border-top: 1px solid var(--line); padding-block: 22px; }
.client-strip .wrap { display: flex; flex-wrap: wrap; gap: 8px 22px; align-items: baseline; }
.client-strip .eyebrow { margin-inline-end: 6px; }
.client-strip span.name { font-family: var(--font-display); font-weight: 500; color: var(--muted); white-space: nowrap; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .facts li { grid-template-columns: 3.6rem 1fr; }
}

/* Audiences / services */
.audiences { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.audience {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px 24px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 14px;
  min-width: 0;
}
.audience .tag { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ochre); }
.audience p.who { color: var(--muted); font-size: 0.97rem; }
.ticks { list-style: none; display: grid; gap: 10px; align-content: start; }
.ticks li { position: relative; padding-inline-start: 22px; line-height: 1.45; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 2px; top: 0.6em; width: 9px; height: 2px; background: var(--accent); }
.audience a.more { font-weight: 600; text-decoration: none; }
.audience a.more:hover { text-decoration: underline; }
@media (max-width: 960px) { .audiences { grid-template-columns: 1fr; } }

/* Two goal bands: businesses and international teams */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.split-copy { display: grid; gap: 18px; min-width: 0; }
.split-copy p { max-width: var(--measure); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.questions { list-style: none; display: grid; gap: 12px; }
.questions li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  gap: 4px;
}
.questions q { font-family: var(--font-display); font-weight: 500; font-size: 1.08rem; quotes: "\201C" "\201D"; }
.questions span { color: var(--muted); font-size: 0.93rem; }

.proof {
  border-inline-start: 3px solid var(--ochre);
  padding: 4px 0 4px 16px;
  padding-inline-start: 16px;
  color: var(--ink);
}

.checklist { list-style: none; display: grid; gap: 0; border-top: 1px solid var(--line); }
.checklist li { display: grid; grid-template-columns: 1.6rem 1fr; gap: 10px; padding-block: 14px; border-bottom: 1px solid var(--line); }
.checklist li svg { width: 20px; height: 20px; margin-top: 3px; color: var(--accent); }
.checklist strong { font-weight: 600; }

/* Selected work */
.work-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.work-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  min-width: 0;
}
.work-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); letter-spacing: 0.02em; }
.work-meta .yr { color: var(--ochre); font-weight: 500; }
.work-card h3 { font-size: 1.12rem; }
.work-card p { font-size: 0.96rem; color: var(--muted); }
.work-role { font-size: 0.9rem; border-top: 1px solid var(--line); padding-top: 12px; }
.work-role b { font-weight: 600; }
.status { display: inline-block; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 999px; background: var(--ochre-soft); color: var(--ink); }
.section-foot { margin-top: 28px; }
@media (max-width: 960px) { .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .work-grid { grid-template-columns: 1fr; } }

/* Map */
.map-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.map-figure { margin: 0; min-width: 0; }
.map { display: block; width: 100%; height: auto; direction: ltr; }
.map-neighbour { fill: var(--map-neighbour); stroke: var(--map-stroke); stroke-width: 1; stroke-opacity: 0.5; }
.map-land { fill: var(--map-land); stroke: var(--map-stroke); stroke-width: 1.5; }
.map-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
.map-label { font-family: var(--font-body); font-size: 23px; font-weight: 500; fill: var(--ink); paint-order: stroke; stroke: var(--bg); stroke-width: 5px; stroke-linejoin: round; }
.map-sea { font-family: var(--font-body); font-style: italic; font-size: 22px; fill: var(--muted); letter-spacing: 0.08em; }
.map-caption { font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.regions { display: grid; gap: 18px; }
.region h3 { display: flex; align-items: baseline; gap: 10px; font-size: 1.08rem; }
.region h3 .key { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); flex: none; transform: translateY(-1px); }
[dir="rtl"] .questions q { quotes: none; }
.region p { color: var(--muted); font-size: 0.96rem; margin-top: 4px; }
@media (max-width: 860px) { .map-grid { grid-template-columns: 1fr; } }

/* Process */
.steps { list-style: none; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.steps li { counter-increment: step; padding: 18px 18px 6px 0; padding-inline-end: 18px; padding-inline-start: 0; display: grid; gap: 8px; align-content: start; min-width: 0; }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--font-mono); font-size: 0.85rem; color: var(--ochre); font-weight: 500; }
.steps h3 { font-size: 1.04rem; }
.steps p { font-size: 0.93rem; color: var(--muted); }
@media (max-width: 960px) { .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 8px; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }

.principles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 40px; }
.principles div { display: grid; gap: 6px; align-content: start; }
.principles h3 { font-size: 1rem; }
.principles p { font-size: 0.93rem; color: var(--muted); }
@media (max-width: 960px) { .principles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .principles { grid-template-columns: 1fr; } }

/* About */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: grid;
  gap: 16px;
}
.monogram { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; }
.profile-card dl { margin: 0; display: grid; gap: 10px; }
.profile-card dt { font-family: var(--font-mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.profile-card dd { margin: 0; font-size: 0.97rem; }
.about-copy { display: grid; gap: 16px; min-width: 0; }
.about-copy p { max-width: var(--measure); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }

/* Funders */
.funders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.funders h3 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; margin-bottom: 10px; }
.funders ul { list-style: none; display: grid; gap: 6px; }
.funders li { font-size: 0.96rem; line-height: 1.4; }
.funders-note { margin-top: 24px; font-size: 0.85rem; color: var(--muted); max-width: var(--measure); }
@media (max-width: 960px) { .funders { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .funders { grid-template-columns: 1fr; } }

/* Contact */
.contact { background: var(--accent-strong); color: #ffffff; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.contact h2 { color: #ffffff; }
.contact p { color: #d5ebe8; max-width: 34em; }
.contact .eyebrow { color: #a9d5cf; }
.contact-list { list-style: none; display: grid; gap: 0; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.contact-list li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding-block: 16px; border-bottom: 1px solid rgba(255, 255, 255, 0.25); align-items: baseline; min-width: 0; }
.contact-list .k { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: #a9d5cf; }
.contact-list .v { min-width: 0; overflow-wrap: anywhere; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: baseline; }
.contact-list a { color: #ffffff; font-weight: 600; font-size: 1.05rem; }
.contact-list a:hover { color: #ffe3b3; }
.copy-btn { background: transparent; color: #d5ebe8; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 6px; font: 500 0.8rem var(--font-body); padding: 3px 10px; cursor: pointer; }
.copy-btn:hover { background: rgba(255, 255, 255, 0.1); }
.contact .btn-primary { background: #ffffff; color: #074e52; border-color: #ffffff; }
.contact .btn-primary:hover { background: #ffe3b3; border-color: #ffe3b3; color: #074e52; }
.contact :focus-visible { outline-color: #ffffff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .contact { background: #0b3e41; }
}
:root[data-theme="dark"] .contact { background: #0b3e41; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 420px) { .contact-list li { grid-template-columns: 1fr; gap: 4px; } }

/* Footer */
.site-footer { padding-block: 28px; font-size: 0.88rem; color: var(--muted); border-top: 1px solid var(--line); }
.footer-row { display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; }
.site-footer a { color: var(--muted); }

/* Work record page */
.page-head { padding-block: clamp(40px, 6vw, 72px) 24px; display: grid; gap: 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 8px 28px; }
.chip {
  font: 500 0.92rem var(--font-body);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-family: var(--font-mono); font-size: 0.78rem; opacity: 0.75; margin-inline-start: 4px; }
.record { list-style: none; display: grid; border-top: 2px solid var(--ink); }
.entry { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) minmax(0, 15rem); gap: 8px 28px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.entry .when { font-family: var(--font-mono); font-size: 0.85rem; color: var(--ochre); font-weight: 500; padding-top: 3px; }
.entry .what { display: grid; gap: 8px; min-width: 0; }
.entry h2 { font-size: 1.12rem; line-height: 1.3; font-weight: 600; }
.entry .what p { color: var(--muted); font-size: 0.96rem; max-width: 60ch; }
.entry .who { font-size: 0.92rem; display: grid; gap: 4px; align-content: start; min-width: 0; }
.entry .who b { font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.03em; padding: 2px 8px; border-radius: 4px; background: var(--band); color: var(--muted); }
.empty-note { padding-block: 24px; color: var(--muted); }
@media (max-width: 860px) {
  .entry { grid-template-columns: 1fr; gap: 8px; }
}

/* Arabic, right to left */
[dir="rtl"] body, body[dir="rtl"] { font-family: "IBM Plex Sans Arabic", var(--font-body); line-height: 1.75; }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { letter-spacing: 0; line-height: 1.35; }
[dir="rtl"] .eyebrow, [dir="rtl"] .factbox-title, [dir="rtl"] .audience .tag, [dir="rtl"] .funders h3, [dir="rtl"] .profile-card dt, [dir="rtl"] .contact-list .k { font-family: "IBM Plex Sans Arabic", var(--font-body); text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 500; }
[dir="rtl"] .proof { padding: 4px 16px 4px 0; }
[dir="rtl"] .map-label, [dir="rtl"] .map-sea { font-family: "IBM Plex Sans Arabic", sans-serif; font-style: normal; letter-spacing: 0; }
[dir="rtl"] .lang-link { font-family: var(--font-body); }
[dir="rtl"] .ltr { direction: ltr; unicode-bidi: isolate; }
