/* ==========================================================================
   IbnKhafagah for Development — site stylesheet

   Hand-written, no build step: the deployment target is ordinary PHP hosting,
   so the CSS ships as-is and needs no npm on the server.

   The palette is dark only. The brand mark is a glowing blue on near-black and
   has no light-background lockup, so a light theme would need different artwork
   before it could look right.

   Layout is logical-property based (inline-start/end, margin-inline) so the same
   rules serve both the Arabic RTL and English LTR renderings.
   ========================================================================== */

/* ---------- design tokens ---------- */
:root {
  --bg:          #070b14;
  --bg-raised:   #0b1220;
  --surface:     #0f1728;
  --surface-hi:  #131d33;
  --line:        #1b2740;
  --line-hi:     #26375a;

  --text:        #e8eefc;
  --muted:       #93a3c4;
  --dim:         #6b7c9e;

  --brand:       #2b90f7;
  --brand-soft:  #6fb6ff;
  --brand-wash:  rgba(43, 144, 247, .10);
  --brand-edge:  rgba(43, 144, 247, .34);

  --ok:          #34d399;
  --warn:        #fbbf24;
  --danger:      #f87171;

  --radius:      14px;
  --radius-sm:   10px;
  --shell:       1200px;

  --sans: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, "Noto Sans Arabic", Tahoma, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", "Consolas", monospace;

  --ease: cubic-bezier(.4, 0, .2, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--brand); color: #fff; }

/* ---------- shared primitives ---------- */
.shell {
  width: min(100% - 40px, var(--shell));
  margin-inline: auto;
}

.mono { font-family: var(--mono); font-variant-ligatures: none; }

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brand-soft);
}

/* section heading: an index number beside the title, editor-gutter style */
.sec { padding: 96px 0; position: relative; }
.sec + .sec { border-top: 1px solid var(--line); }

.sec-head {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-bottom: 44px;
}

.sec-idx {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brand);
  padding-top: 10px;
  opacity: .8;
  flex: none;
}

.sec-head h2 { font-size: clamp(26px, 3.4vw, 38px); }

.sec-sub {
  color: var(--muted);
  margin-top: 10px;
  max-width: 68ch;
  font-size: 16px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 24px -10px rgba(43, 144, 247, .8);
}
.btn-primary:hover { background: #4aa2ff; transform: translateY(-2px); }

.btn-ghost {
  background: transparent;
  border-color: var(--line-hi);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--brand-edge); background: var(--brand-wash); }

/* ==========================================================================
   header
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(7, 11, 20, .82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-in {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 68px;
}

.brand { display: flex; align-items: center; gap: 12px; flex: none; }
.brand svg { width: 38px; height: auto; color: var(--brand); flex: none; }

.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 700; font-size: 15px; }
.brand-sub {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--dim);
}

.topnav { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; }

.topnav a.navlink {
  padding: 8px 13px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--muted);
  transition: color .16s var(--ease), background .16s var(--ease);
}
.topnav a.navlink:hover { color: var(--text); background: var(--surface); }

.ctrl {
  background: transparent;
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-family: var(--mono);
  color: var(--muted);
  cursor: pointer;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}
.ctrl:hover { border-color: var(--brand-edge); color: var(--brand-soft); }

.nav-toggle { display: none; }

/* ==========================================================================
   hero
   ========================================================================== */
.hero {
  position: relative;
  padding: 108px 0 84px;
  overflow: hidden;
}

/* a soft brand glow plus a faint grid — the "engineering blueprint" cue */
.hero::before {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: -220px;
  width: 900px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(43, 144, 247, .18), transparent 72%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 78%);
  opacity: .5;
  pointer-events: none;
}

.hero-in { position: relative; z-index: 1; max-width: 900px; }

.hero h1 {
  font-size: clamp(32px, 5.4vw, 58px);
  margin: 18px 0 20px;
  letter-spacing: -.02em;
}

.hero-lede {
  color: var(--muted);
  font-size: clamp(16px, 1.9vw, 19px);
  max-width: 66ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.hero-note {
  margin-top: 22px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--dim);
}

/* ==========================================================================
   metrics strip
   ========================================================================== */
.metrics { border-block: 1px solid var(--line); background: var(--bg-raised); }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border-inline: 1px solid var(--line);
}

.metric {
  background: var(--bg-raised);
  padding: 26px 18px;
  text-align: center;
}
.metric-n {
  font-family: var(--mono);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 700;
  color: var(--brand-soft);
}
.metric-l { font-size: 12.5px; color: var(--dim); margin-top: 6px; }

.metrics-note {
  text-align: center;
  padding: 14px 0;
  font-size: 12.5px;
  color: var(--dim);
}

/* ==========================================================================
   services
   ========================================================================== */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.svc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: border-color .2s var(--ease), background .2s var(--ease), transform .2s var(--ease);
}
.svc:hover {
  border-color: var(--brand-edge);
  background: var(--surface-hi);
  transform: translateY(-3px);
}

.svc-k {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--brand);
  background: var(--brand-wash);
  border: 1px solid var(--brand-edge);
  border-radius: 6px;
  padding: 3px 9px;
  margin-bottom: 14px;
}

.svc h3 { font-size: 17px; margin-bottom: 9px; }
.svc p { color: var(--muted); font-size: 14.5px; }

/* ==========================================================================
   work
   ========================================================================== */
.filters { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 26px; }

.filter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 17px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  transition: all .16s var(--ease);
}
.filter:hover { border-color: var(--line-hi); color: var(--text); }
.filter[aria-pressed="true"] {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 18px;
}

.proj {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease);
}
.proj:hover {
  border-color: var(--brand-edge);
  transform: translateY(-4px);
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, .9);
}

/* the whole card is one link to the project page */
.proj-link { display: flex; flex-direction: column; flex: 1; }

.proj-shot {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  width: 100%;
  padding: 0;
  border-inline: 0;
  border-top: 0;
  display: block;
}
.proj-shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .5s var(--ease), opacity .3s var(--ease);
}
.proj-shot:hover img { transform: scale(1.045); }

/* imageless entries show their headline structural figure instead */
.proj-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 4px;
  background:
    radial-gradient(closest-side, rgba(43, 144, 247, .13), transparent 78%),
    var(--bg-raised);
}
.proj-badge b { font-family: var(--mono); font-size: 42px; color: var(--brand-soft); }
.proj-badge span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .16em;
  color: var(--dim);
}

.proj-body { padding: 20px 20px 22px; display: flex; flex-direction: column; flex: 1; }
.proj h3 { font-size: 16.5px; margin-bottom: 9px; }
.proj p { color: var(--muted); font-size: 14px; flex: 1; }

.proj-metrics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }

.chip {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 9px;
}
.chip b { color: var(--brand-soft); font-weight: 600; }

.proj-stack {
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--dim);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

/* visible but quiet by default — hover is not available on touch */
.proj-more { flex: none; color: var(--brand-soft); opacity: .55; transition: opacity .2s var(--ease); }
.proj:hover .proj-more, .proj-link:focus-visible .proj-more { opacity: 1; }

.proj[hidden] { display: none; }

.work-empty { color: var(--dim); padding: 30px 0; }

/* ==========================================================================
   process
   ========================================================================== */
.steps { display: grid; gap: 14px; }

.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 20px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  transition: border-color .2s var(--ease);
}
.step:hover { border-color: var(--brand-edge); }

.step-n {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--brand);
  background: var(--brand-wash);
  border: 1px solid var(--brand-edge);
  border-radius: 9px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.step h3 { font-size: 16.5px; margin-bottom: 7px; }
.step p { color: var(--muted); font-size: 14.5px; }

/* ==========================================================================
   about
   ========================================================================== */
.about-lede {
  font-size: clamp(17px, 2.1vw, 21px);
  color: var(--text);
  max-width: 74ch;
  line-height: 1.75;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 38px;
}

.pillar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  border-inline-start: 3px solid var(--brand);
}
.pillar .eyebrow { display: block; margin-bottom: 11px; }
.pillar h3 { font-size: 16px; margin-bottom: 8px; }
.pillar p { color: var(--muted); font-size: 14.5px; }

.tech { margin-top: 42px; display: grid; gap: 22px; }
.tech-row h4 {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--dim);
  margin-bottom: 12px;
  text-transform: uppercase;
}
.tech-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tech-chips span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 12px;
}

/* ==========================================================================
   contact
   ========================================================================== */
.contact-wrap {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 26px;
  align-items: start;
}

.form-card,
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 7px;
}
.field .req { color: var(--brand); }

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--line-hi);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color .16s var(--ease), background .16s var(--ease);
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.7; }
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface-hi);
}
.field input::placeholder,
.field textarea::placeholder { color: var(--dim); }

.field select { cursor: pointer; }
.field select option { background: var(--bg-raised); color: var(--text); }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }
.field input[aria-invalid="true"],
.field textarea[aria-invalid="true"] { border-color: var(--danger); }

/* honeypot — off-screen rather than display:none so bots still fill it */
.hp {
  position: absolute;
  inset-inline-start: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-note { font-size: 12.5px; color: var(--dim); margin-top: 14px; }

.alert {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 22px;
  font-size: 14.5px;
  border: 1px solid;
}
.alert-ok {
  background: rgba(52, 211, 153, .10);
  border-color: rgba(52, 211, 153, .38);
  color: #86efc4;
}
.alert-bad {
  background: rgba(248, 113, 113, .10);
  border-color: rgba(248, 113, 113, .38);
  color: #fca5a5;
}

.contact-list { display: grid; gap: 2px; }
.contact-item {
  display: block;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}
.contact-item:last-child { border-bottom: 0; }
.contact-k {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: var(--dim);
  display: block;
  margin-bottom: 5px;
}
.contact-v { font-size: 15px; color: var(--text); word-break: break-word; }
a.contact-item:hover .contact-v { color: var(--brand-soft); }

.profile-dl {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ==========================================================================
   footer
   ========================================================================== */
footer {
  border-top: 1px solid var(--line);
  background: var(--bg-raised);
  padding: 34px 0;
}
.foot-in {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--dim);
}
.foot-in .mono { font-size: 11.5px; }

/* ==========================================================================
   lightbox
   ========================================================================== */
.lb {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 7, 13, .93);
  backdrop-filter: blur(6px);
  display: none;
  flex-direction: column;
}
.lb[open], .lb.is-open { display: flex; }

.lb-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.lb-title { font-size: 14.5px; color: var(--text); }
.lb-close {
  margin-inline-start: auto;
  background: transparent;
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  padding: 7px 14px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.lb-close:hover { border-color: var(--brand-edge); color: var(--brand-soft); }

.lb-img {
  flex: 1;
  overflow: auto;
  padding: 22px;
  display: grid;
  place-items: start center;
}
.lb-img img {
  max-width: 1200px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ==========================================================================
   project detail page  (/work/{slug})

   Shares the card, chip and lightbox primitives above; everything specific to
   the case-study layout is prefixed .pd- so it cannot collide with the home
   page sections.
   ========================================================================== */
.pd-hero {
  position: relative;
  padding: 44px 0 36px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.pd-hero::before {
  content: "";
  position: absolute;
  inset-inline-start: -12%;
  top: -70%;
  width: 65%;
  height: 220%;
  background: radial-gradient(closest-side, var(--brand-wash), transparent 72%);
  pointer-events: none;
}

.pd-crumbs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--dim);
  margin-bottom: 28px;
}
.pd-crumbs a { color: var(--muted); }
.pd-crumbs a:hover { color: var(--brand-soft); }
.pd-crumb-now { color: var(--dim); }

.pd-hero-in {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 40px;
  align-items: end;
}

.pd-hero h1 { font-size: clamp(27px, 4.2vw, 44px); margin-top: 12px; }

.pd-lede {
  color: var(--muted);
  font-size: 17px;
  margin-top: 15px;
  max-width: 62ch;
}

/* the same facts as the sidebar, condensed for the top of the page */
.pd-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 22px 0 0;
}
.pd-tags li {
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
}
.pd-tags .mono {
  font-size: 10.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--dim);
  margin-inline-end: 8px;
}

.pd-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.pd-figures { display: grid; gap: 10px; min-width: 200px; }
.pd-figure {
  display: flex;
  align-items: baseline;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 15px;
}
.pd-figure b { font-size: 21px; color: var(--brand-soft); }
.pd-figure span {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--dim);
}

/* ---------- lead screenshot ---------- */
.pd-shot {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 34px;
  padding: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.pd-shot img { width: 100%; height: auto; transition: transform .6s var(--ease); }
.pd-shot:hover img { transform: scale(1.015); }

.pd-shot-hint {
  position: absolute;
  inset-block-end: 12px;
  inset-inline-end: 12px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(7, 11, 20, .82);
  border: 1px solid var(--line-hi);
  border-radius: 7px;
  padding: 5px 10px;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.pd-shot:hover .pd-shot-hint, .pd-shot:focus-visible .pd-shot-hint { opacity: 1; }

.pd-badge {
  margin-top: 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 56px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(closest-side, rgba(43, 144, 247, .13), transparent 78%),
    var(--bg-raised);
}
.pd-badge b { font-size: 54px; color: var(--brand-soft); }
.pd-badge span {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--dim);
}

/* ---------- narrative column + sticky facts ---------- */
.pd-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 46px;
  align-items: start;
}

/* nothing written for the narrative yet: the cards spread across instead of
   leaving an empty column beside them */
.pd-cols-solo { grid-template-columns: 1fr; }
.pd-cols-solo .pd-aside {
  position: static;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pd-block + .pd-block { margin-top: 38px; }
.pd-block h2 {
  font-size: clamp(20px, 2.4vw, 26px);
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.pd-block-idx { font-size: 13px; color: var(--brand); opacity: .85; }
.pd-block p { color: var(--muted); font-size: 15.5px; max-width: 70ch; }
.pd-block p + p { margin-top: 12px; }

.pd-aside { position: sticky; top: 92px; display: grid; gap: 14px; }

.pd-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
}
.pd-card h3 {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 600;
  margin-bottom: 14px;
}

.pd-facts { margin: 0; display: grid; gap: 1px; }
.pd-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.pd-facts > div:last-child { border-bottom: 0; }
.pd-facts dt { font-size: 13px; color: var(--dim); flex: none; }
.pd-facts dd { margin: 0; font-size: 14px; text-align: end; }

.pd-card-cta p { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.pd-card-cta .btn { width: 100%; justify-content: center; }
.pd-wa {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 11.5px;
  color: var(--dim);
}
.pd-wa:hover { color: var(--brand-soft); }

/* ---------- feature list ---------- */
.pd-feature-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.pd-feature {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  transition: border-color .2s var(--ease);
}
.pd-feature:hover { border-color: var(--brand-edge); }
.pd-feature-n { font-size: 12px; color: var(--brand); flex: none; padding-top: 3px; }
.pd-feature p { color: var(--muted); font-size: 14.5px; }

/* ---------- grouped technologies ---------- */
.pd-tech-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
}
.pd-tech-group h4 {
  font-size: 11.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 12px;
}

/* ---------- gallery ---------- */
.pd-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 18px;
}
.pd-shot-item { margin: 0; }
.pd-shot-item button {
  display: block;
  width: 100%;
  padding: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 16 / 10;
}
.pd-shot-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform .5s var(--ease);
}
.pd-shot-item button:hover { border-color: var(--brand-edge); }
.pd-shot-item button:hover img { transform: scale(1.04); }
.pd-shot-item figcaption { font-size: 13px; color: var(--dim); margin-top: 10px; }

/* ---------- previous / next ---------- */
.pd-nav { border-top: 1px solid var(--line); background: var(--bg-raised); }
.pd-nav-in {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 26px 0;
}
.pd-nav-link {
  display: grid;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.pd-nav-link:hover { border-color: var(--brand-edge); transform: translateY(-2px); }
.pd-nav-link .mono { font-size: 11px; letter-spacing: .12em; color: var(--dim); }
.pd-nav-link b { font-size: 15px; }
.pd-nav-next { text-align: end; }

/* ==========================================================================
   scroll reveal — opt-in, and disabled entirely without JS or with
   reduced-motion, so content is never trapped invisible
   ========================================================================== */
.js-reveal .rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .55s var(--ease), transform .55s var(--ease);
}
.js-reveal .rv.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .rv { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   responsive
   ========================================================================== */
@media (max-width: 1000px) {
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .contact-wrap { grid-template-columns: 1fr; }

  /* the facts panel stops being a sidebar and becomes a band above the text */
  .pd-cols { grid-template-columns: 1fr; gap: 32px; }
  .pd-aside { position: static; grid-template-columns: repeat(2, 1fr); }
  .pd-hero-in { grid-template-columns: 1fr; align-items: start; }
  .pd-figures { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); min-width: 0; }
}

@media (max-width: 720px) {
  .sec { padding: 66px 0; }
  .sec-head { gap: 14px; margin-bottom: 32px; }
  .hero { padding: 72px 0 58px; }

  .nav-toggle {
    display: inline-flex;
    margin-inline-start: auto;
  }
  .topnav {
    display: none;
    position: absolute;
    top: 68px;
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 20px 20px;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--line);
    margin-inline-start: 0;
  }
  .topnav.is-open { display: flex; }
  .topnav a.navlink { padding: 11px 12px; }
  .topnav .ctrl { align-self: flex-start; }

  .field-row { grid-template-columns: 1fr; }
  .step { grid-template-columns: 1fr; gap: 12px; }
  .form-card, .contact-card { padding: 22px 18px; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }

  .pd-aside { grid-template-columns: 1fr; }
  .pd-hero-cta .btn { flex: 1 1 100%; justify-content: center; }
  .pd-nav-in { grid-template-columns: 1fr; }
  .pd-nav-next { text-align: start; }
}

@media (max-width: 460px) {
  .metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid, .svc-grid, .pd-shots { grid-template-columns: 1fr; }
}

/* ---------- print: the page itself is not the deliverable, the PDF is ---- */
@media print {
  .topbar, .hero-cta, .filters, .lb, footer .mono, .form-card { display: none; }
  body { background: #fff; color: #000; }
}
