/* ==========================================================
   Nusur Al-Arafa landing page
   Palette from the company letterhead: signal yellow accent,
   deep navy ink, blue double rule.
   Motif: construction-drawing sheet (grid paper, dimension
   lines, title block). Boldness is spent on the hero only.
   ========================================================== */

:root {
  --concrete: #eef0f2;
  --slab: #dfe3e7;
  --steel: #0f2a44;
  --steel-2: #1a3a5c;
  --ochre: #f2c200;
  --ochre-deep: #7a6100;
  --blue: #1f5fa6;
  --paper: #fafaf8;
  --ink: #0f2a44;
  --ink-soft: #4a5866;
  --line: rgba(15, 42, 68, 0.18);
  --grid: rgba(15, 42, 68, 0.06);

  --f-display: "Reem Kufi", "IBM Plex Sans Arabic", sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;

  /* modular scale 1.25 on 18px */
  --s-0: 1.125rem;
  --s-1: 1.4rem;
  --s-2: 1.75rem;
  --s-3: 2.2rem;
  --s-4: 2.75rem;

  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  --radius: 3px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: var(--s-0);
  line-height: 1.8;
  color: var(--ink);
  background: var(--concrete);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }

:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--steel); color: var(--paper); padding: 8px 14px; z-index: 100; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 26px;
  font: 600 1rem/1 var(--f-body);
  text-decoration: none; border-radius: var(--radius);
  border: 2px solid transparent; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--ochre); color: var(--steel); }
.btn-primary:hover { background: #ffd21f; }
.btn-ghost { border-color: currentColor; color: var(--steel); background: transparent; }
.btn-ghost:hover { background: var(--steel); color: var(--paper); border-color: var(--steel); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(238, 240, 242, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-row { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: stretch; gap: 12px; text-decoration: none; }
.brand-logo { width: 48px; height: 48px; flex: none; align-self: center; }
.brand-bar { width: 4px; background: var(--ochre); flex: none; }
.brand-text { display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
.brand-name { font-family: var(--f-display); font-weight: 700; font-size: 1.3rem; }
.brand-sub { font-size: 0.78rem; color: var(--ink-soft); font-weight: 500; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { text-decoration: none; font-weight: 500; font-size: 1rem; color: var(--ink-soft); }
.site-nav a:hover { color: var(--ink); }
.site-nav .nav-cta { color: var(--steel); background: var(--ochre); padding: 9px 18px; border-radius: var(--radius); font-weight: 600; }
.site-nav .nav-cta:hover { background: #ffd21f; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; flex-direction: column; justify-content: space-between; }
.nav-toggle span:not(.sr) { display: block; height: 2px; background: var(--steel); }

@media (max-width: 900px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; inset-inline: 0; top: 68px;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--concrete); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    display: none;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { margin-top: 14px; text-align: center; border: 0; }
}

/* ---------- hero: the drawing sheet ---------- */
.hero {
  position: relative;
  padding: clamp(40px, 6vw, 80px) 0 clamp(48px, 6vw, 80px);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(rgba(15,42,68,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,42,68,.025) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 12px 12px, 12px 12px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: end; }

.wordmark {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: clamp(4.2rem, 12vw, 10rem);
  line-height: 1.05;
  color: var(--steel);
  letter-spacing: 0;
}
.wm-line { display: inline-block; }
.wm-line + .wm-line { color: var(--ochre); margin-inline-start: 0.22em; }

/* dimension line under the wordmark */
.dim { display: flex; align-items: center; gap: 12px; margin: 12px 0 28px; color: var(--ink-soft); max-width: 640px; }
.dim-tick { width: 2px; height: 18px; background: var(--ink-soft); flex: none; }
.dim-rule { height: 1px; background: var(--ink-soft); flex: 1; }
.dim-label { font-size: 1rem; font-weight: 500; white-space: nowrap; }

.hero-en { font-family: var(--f-display); font-weight: 700; font-size: 1.05rem; letter-spacing: .02em; color: var(--steel); text-align: right; margin-bottom: 18px; }
.hero-en span { display: block; font-weight: 500; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.hero-lead { font-size: var(--s-1); line-height: 1.7; max-width: 40ch; color: var(--ink); }

/* photo band under the hero */
.hero-photo { margin: 0; background: var(--steel); border-bottom: 4px solid var(--ochre); }
.hero-photo img { width: 100%; height: clamp(220px, 34vw, 460px); object-fit: cover; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* the title block, as on the corner of an engineering drawing */
.title-block {
  border: 2px solid var(--steel);
  background: var(--paper);
  font-size: 0.95rem;
}
.title-block dl { display: grid; grid-template-columns: 1fr 1fr; }
.title-block dl > div { padding: 12px 16px; border-bottom: 1px solid var(--steel); }
.title-block dl > div:nth-child(odd):not(.tb-wide):not(.tb-full) { border-inline-end: 1px solid var(--steel); }
.title-block dl > div:last-child { border-bottom: 0; }
.title-block .tb-wide { grid-column: 1 / -1; background: var(--steel); color: var(--paper); }
.title-block dt { color: var(--ink-soft); font-size: 0.85rem; }
.title-block .tb-wide dt { color: var(--slab); }
.title-block dd { font-family: var(--f-display); font-weight: 600; font-size: 1.6rem; line-height: 1.3; }
.title-block .tb-wide dd { font-size: 1.2rem; }
.title-block dd bdi { white-space: nowrap; }
.title-block .tb-full { grid-column: 1 / -1; }

/* single orchestrated load moment: wordmark sets, then dimension line draws */
@media (prefers-reduced-motion: no-preference) {
  .wm-line { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
  .wm-line:nth-child(2) { animation-delay: .12s; }
  .dim-rule { transform-origin: center; animation: draw .6s .55s ease-out both; }
  .dim-tick, .dim-label { animation: fade .4s .9s both; }
  .title-block { animation: fade .5s .7s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .title-block { max-width: 460px; }
}

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-tight { padding: clamp(40px, 6vw, 64px) 0; border-top: 1px solid var(--line); }
.section-slab { background: var(--slab); }
.section-steel { background: var(--steel); color: var(--paper); }
.section-steel .lead, .section-steel p { color: #c9d0d3; }

.section-title {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 5vw, var(--s-4));
  margin-bottom: 24px;
  position: relative;
  padding-bottom: 14px;
}
.section-title::after {
  content: ""; position: absolute; bottom: 0; inset-inline-start: 0;
  width: 56px; height: 4px; background: var(--ochre);
}
.section-title.small { font-size: var(--s-3); }

.lead { font-size: var(--s-1); line-height: 1.7; max-width: 42ch; }
.lead.narrow { margin-bottom: 48px; }

/* about */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(40px, 7vw, 96px); }
.about-grid > div p:not(.lead) { max-width: 60ch; color: var(--ink-soft); }
.about-grid .lead { margin-bottom: 1.2em; }
@media (max-width: 900px) { .about-grid { grid-template-columns: 1fr; } }
.values { border-top: 2px solid var(--steel); }
.values li { padding: 22px 0; border-bottom: 1px solid var(--line); }
.values h3 { font-size: var(--s-1); font-weight: 600; margin-bottom: 6px; }
.values p { color: var(--ink-soft); }

/* services */
.services { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 2px solid var(--steel); }
.services li { padding: 32px 28px 36px 0; border-bottom: 1px solid rgba(15,42,68,.25); }
.services li:not(:nth-child(3n)) { border-inline-end: 1px solid rgba(15,42,68,.25); }
.services li:nth-child(3n+2), .services li:nth-child(3n) { padding-inline-start: 28px; }
.svc-icon { width: 44px; height: 44px; fill: none; stroke: var(--steel); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; margin-bottom: 18px; }
.services h3 { font-size: var(--s-1); font-weight: 600; margin-bottom: 8px; }
.services p { color: var(--ink-soft); max-width: 32ch; }

@media (max-width: 900px) {
  .services { grid-template-columns: 1fr 1fr; }
  .services li { padding: 28px 20px 28px 0 !important; border-inline-end: 0 !important; }
  .services li:nth-child(odd) { border-inline-end: 1px solid rgba(15,42,68,.25) !important; }
  .services li:nth-child(even) { padding-inline-start: 20px !important; }
}
@media (max-width: 560px) {
  .services { grid-template-columns: 1fr; }
  .services li { padding: 24px 0 !important; border-inline-end: 0 !important; }
}

/* projects */
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 32px; margin-bottom: 32px; }
.section-head .section-title { margin-bottom: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 500 0.95rem/1 var(--f-body);
  padding: 10px 18px; min-height: 40px;
  border: 1px solid var(--steel); border-radius: 999px;
  background: transparent; color: var(--steel); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--steel); color: var(--paper); }
.chip:hover:not([aria-pressed="true"]) { background: rgba(15,42,68,.07); }

.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 28px; }
.project[hidden] { display: none; }
.project-open {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  text-align: start; font: inherit; color: inherit; cursor: pointer;
}
.project-open .ph { aspect-ratio: 4 / 3; border: 1px solid var(--line); overflow: hidden; transition: filter .2s; }
.project-open:hover .ph { filter: brightness(.94); }
.project-open:hover .project-name { text-decoration: underline; text-decoration-color: var(--ochre); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.project-meta { display: block; padding-top: 14px; }
.project-name { display: block; font-weight: 600; font-size: var(--s-1); line-height: 1.4; }
.project-sub { display: block; color: var(--ink-soft); font-size: 0.95rem; margin-top: 4px; }

/* image placeholders: hatch patterns from drawing conventions (concrete, earth, steel).
   Replace with <img> when real photos arrive. */
.ph { display: block; background-color: var(--slab); }
.ph-a { background-image: repeating-linear-gradient(45deg, rgba(15,42,68,.16) 0 1px, transparent 1px 12px); background-color: #d9d5cc; }
.ph-b { background-image: repeating-linear-gradient(-45deg, rgba(143,100,25,.28) 0 2px, transparent 2px 14px), repeating-linear-gradient(45deg, rgba(143,100,25,.14) 0 1px, transparent 1px 14px); background-color: #e2d7c2; }
.ph-c { background-image: radial-gradient(rgba(15,42,68,.28) 1.2px, transparent 1.6px), radial-gradient(rgba(15,42,68,.16) 1px, transparent 1.4px); background-size: 14px 14px, 9px 9px; background-position: 0 0, 5px 7px; background-color: #d3d4d0; }
.project-open img, .modal-media img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 900px) { .projects { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .projects { grid-template-columns: 1fr; } }

.more-contracts { margin-top: 56px; border-top: 2px solid var(--steel); padding-top: 20px; }
.more-contracts h3 { font-size: var(--s-0); font-weight: 600; margin-bottom: 10px; }
.more-contracts ul { display: flex; flex-wrap: wrap; gap: 10px; }
.more-contracts li { padding: 10px 16px; border: 1px solid var(--line); background: var(--paper); font-weight: 500; }
.more-contracts li span { color: var(--ochre-deep); margin-inline-start: 8px; font-weight: 600; }

/* experience */
.exp-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(40px, 7vw, 96px); }
.credentials { margin-top: 36px; border-top: 1px solid rgba(247,246,243,.25); }
.credentials li { padding: 14px 0 14px; padding-inline-start: 28px; border-bottom: 1px solid rgba(247,246,243,.25); position: relative; color: var(--paper); }
.credentials li::before { content: ""; position: absolute; inset-inline-start: 0; top: 1.4em; width: 12px; height: 2px; background: var(--ochre); }

.timeline { position: relative; padding-inline-start: 36px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 7px; top: 12px; bottom: 12px; width: 2px; background: rgba(247,246,243,.25); }
.timeline li { position: relative; padding-bottom: 32px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: -36px; top: 12px; width: 16px; height: 16px; background: var(--steel); border: 3px solid var(--ochre); }
.tl-year { display: block; font-family: var(--f-display); font-weight: 600; font-size: var(--s-2); color: var(--ochre); line-height: 1.3; }
.timeline p { margin-top: 4px; max-width: 44ch; }

@media (max-width: 900px) { .exp-grid { grid-template-columns: 1fr; } }

/* manager entry in the about facts list */
.values .manager p { font-family: var(--f-display); font-weight: 600; font-size: var(--s-1); color: var(--ink); }

/* equipment */
.equip-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.equip-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.equip-table th { text-align: start; font-weight: 600; font-size: 0.95rem; color: var(--ink-soft); padding: 0 0 10px; border-bottom: 2px solid var(--steel); }
.equip-table td { padding: 12px 0; border-bottom: 1px solid rgba(15,42,68,.22); }
.equip-table th:last-child, .equip-table td:last-child { text-align: end; width: 90px; font-family: var(--f-display); font-weight: 600; font-size: 1.25rem; }
.equip-table th:last-child { font-family: var(--f-body); font-size: 0.95rem; }
@media (max-width: 900px) { .equip-grid { grid-template-columns: 1fr; } }
.equip-photo { margin: 28px 0 0; border: 1px solid var(--line); }
.equip-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.equip-note { margin-top: 20px; color: var(--ink-soft); font-size: 1rem; max-width: 46ch; }

/* process: a real sequence, so it is numbered */
.process { display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: step; border-top: 2px solid var(--steel); }
.process li { counter-increment: step; padding: 24px 20px 0 0; position: relative; }
.process li + li { padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
.process li::before { content: counter(step); display: block; font-family: var(--f-display); font-weight: 600; font-size: var(--s-3); line-height: 1; color: var(--ochre); margin-bottom: 14px; }
.process h3 { font-size: 1.15rem; font-weight: 600; margin-bottom: 6px; }
.process p { color: var(--ink-soft); font-size: 1rem; }
@media (max-width: 900px) {
  .process { grid-template-columns: 1fr; }
  .process li, .process li + li { padding: 20px 0; padding-inline-start: 56px; border-inline-start: 0; border-bottom: 1px solid var(--line); }
  .process li::before { position: absolute; inset-inline-start: 0; top: 20px; }
}

/* careers */
.careers { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.careers p { max-width: 56ch; color: var(--ink-soft); }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 96px); }
.contact-list { margin-top: 32px; border-top: 1px solid rgba(247,246,243,.25); }
.contact-list div { display: grid; grid-template-columns: 120px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid rgba(247,246,243,.25); }
.contact-list dt { color: #9fabb0; }
.contact-list dd a { text-decoration: none; color: var(--paper); }
.contact-list dd a:hover { color: var(--ochre); }
.contact-list [dir="ltr"] { unicode-bidi: isolate; display: inline-block; }
.map-link { display: inline-block; margin-top: 24px; color: var(--ochre); font-weight: 500; text-underline-offset: 5px; }

.contact-form { background: var(--paper); color: var(--ink); padding: clamp(24px, 4vw, 40px); border-top: 4px solid var(--ochre); display: grid; gap: 18px; align-self: start; }
.section-steel .contact-form p.form-note { color: var(--ink-soft); font-size: 0.95rem; }
.contact-form label { display: grid; gap: 6px; }
.contact-form label span { font-weight: 500; font-size: 0.95rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: #fff; border: 1px solid rgba(15,42,68,.35); border-radius: var(--radius);
  padding: 11px 14px; width: 100%;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form input:focus-visible, .contact-form select:focus-visible, .contact-form textarea:focus-visible { outline: 2px solid var(--ochre); outline-offset: 0; border-color: var(--ochre); }
.contact-form [aria-invalid="true"] { border-color: #b3261e; }
.section-steel .contact-form .form-error { color: #b3261e; font-weight: 500; margin: 0; }
.contact-form .btn { width: 100%; }

@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .contact-list div { grid-template-columns: 1fr; gap: 2px; } }

/* footer */
.site-footer { background: #0a1d30; color: #9fabb0; padding: 28px 0; font-size: 0.95rem; border-top: 6px double var(--blue); }
.footer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.site-footer .brand { color: var(--paper); }
.site-footer .brand-sub { color: #9fabb0; letter-spacing: .06em; }
.credit { margin-top: 20px; padding-top: 16px; border-top: 1px solid rgba(247,246,243,.12); text-align: center; font-size: 0.85rem; color: #7d8a90; }
@media (max-width: 900px) { .credit { padding-bottom: 72px; } }

/* whatsapp float */
.wa-float {
  position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 40;
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: #1f9d55; color: #fff;
  box-shadow: 0 6px 18px rgba(10,29,48,.3);
}
.wa-float svg { width: 30px; height: 30px; fill: currentColor; }
.wa-float:hover { background: #188046; }

/* project modal (view-only: backdrop click closes, X is the only control) */
.modal {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; border: 0; border-radius: var(--radius);
  background: var(--paper); color: var(--ink);
}
.modal::backdrop { background: rgba(10,29,48,.7); }
.modal-inner { position: relative; }
.modal-media { aspect-ratio: 16 / 7; }
.modal-body { padding: 28px clamp(20px, 4vw, 36px) 32px; }
.modal-body h2 { font-family: var(--f-display); font-weight: 600; font-size: var(--s-2); }
.modal-sub { color: var(--ink-soft); margin: 4px 0 18px; }
.modal-content p { margin-bottom: 20px; }
.modal-content dl { display: grid; grid-template-columns: 1fr 1fr; border-top: 2px solid var(--steel); }
.modal-content dl div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.modal-content dl div:nth-child(even) { padding-inline-start: 20px; border-inline-start: 1px solid var(--line); }
.modal-content dt { color: var(--ink-soft); font-size: 0.9rem; }
.modal-content dd { font-weight: 600; }
.modal-x {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: 50%; cursor: pointer;
}
.modal-x svg { width: 20px; height: 20px; stroke: var(--steel); stroke-width: 2; fill: none; }
@media (prefers-reduced-motion: no-preference) {
  .modal[open] { animation: fade .18s ease-out; }
}
