/* Techtrade UAE
   One stylesheet for English (LTR) and Arabic (RTL).
   Layout uses logical properties so both directions mirror without overrides. */

:root {
  color-scheme: light dark;

  /* Brand, taken from the logo */
  --navy: #2c3e8a;
  --teal: #549d8a;
  --mist: #e1e5ef;
  --night: #0e1633;
  --night-2: #16204a;

  /* Surfaces (light) */
  --surface: #eef1f5;
  --surface-2: #e2e7ef;
  --text: #141c3d;
  --text-muted: #4a5578;
  --line: rgba(20, 28, 61, 0.14);
  --accent-ink: #2b6f5f;
  --wordmark-solid: #2c3e8a;

  /* Type */
  --font: "Readex Pro", system-ui, "Segoe UI", Tahoma, sans-serif;
  --step--1: clamp(0.84rem, 0.82rem + 0.1vw, 0.9rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.08rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.32rem + 0.9vw, 2rem);
  --step-3: clamp(1.9rem, 1.55rem + 1.8vw, 3rem);
  --step-4: clamp(2.4rem, 1.6rem + 4vw, 4.6rem);
  --track-tight: -0.02em;

  /* Rhythm */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 10vw, 8.5rem);
  --max: 76rem;
  --header-h: 4.75rem;
  --chamfer: 14px;

  --hex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 126.29 139.68'%3E%3Cpath d='M68.56 1.41l52.04 29.05c3.51 1.96 5.69 5.67 5.69 9.7v54.97c0 3.78-1.92 7.3-5.1 9.34l-52.04 33.45c-3.66 2.35-8.35 2.35-12.01 0L5.1 104.46C1.92 102.42 0 98.9 0 95.12V40.15c0-4.03 2.18-7.74 5.69-9.7L57.74 1.41c3.36-1.88 7.46-1.88 10.83 0Z'/%3E%3C/svg%3E");
  --lattice-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38.1' height='66' viewBox='0 0 38.1 66'%3E%3Cg fill='none' stroke='%23e1e5ef'%3E%3Cpath stroke-opacity='.09' d='M19.05 0V11L38.1 22V44L19.05 55V66M19.05 11L0 22V44L19.05 55'/%3E%3Cpath stroke-opacity='.05' d='M19.05 22L28.58 27.5V38.5L19.05 44L9.53 38.5V27.5ZM9.53 0V5.5L0 11M28.58 0V5.5L38.1 11M0 55L9.53 60.5V66M38.1 55L28.58 60.5V66'/%3E%3C/g%3E%3C/svg%3E");
  --lattice-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38.1' height='66' viewBox='0 0 38.1 66'%3E%3Cg fill='none' stroke='%232c3e8a'%3E%3Cpath stroke-opacity='.12' d='M19.05 0V11L38.1 22V44L19.05 55V66M19.05 11L0 22V44L19.05 55'/%3E%3Cpath stroke-opacity='.07' d='M19.05 22L28.58 27.5V38.5L19.05 44L9.53 38.5V27.5ZM9.53 0V5.5L0 11M28.58 0V5.5L38.1 11M0 55L9.53 60.5V66M38.1 55L28.58 60.5V66'/%3E%3C/g%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface: #111a3b;
    --surface-2: #18234f;
    --text: #e1e5ef;
    --text-muted: #a6afc8;
    --line: rgba(225, 229, 239, 0.14);
    --accent-ink: #7fc4b0;
    --wordmark-solid: #e1e5ef;
    --night: #0a1029;
    --lattice-dark: var(--lattice-light);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--step-0);
  font-weight: 300;
  line-height: 1.65;
  color: var(--text);
  background: var(--surface);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

:lang(ar) body,
body:lang(ar) {
  font-size: calc(var(--step-0) * 1.06);
  line-height: 1.85;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

h1, h2, h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.12;
  text-wrap: balance;
}
:lang(en) h1, :lang(en) h2 { letter-spacing: var(--track-tight); }
:lang(ar) h1, :lang(ar) h2, :lang(ar) h3 { line-height: 1.4; }

p { margin: 0; text-wrap: pretty; }

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -4rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--teal);
  color: var(--night);
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus { inset-block-start: 1rem; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

/* Numbers, phone and email stay left to right inside Arabic text */
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* Buttons. The chamfered corners echo the hexagon in the logo. The shape sits on
   ::before so the focus outline on the button itself is never clipped. */
.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 3.1rem;
  padding: 0.7rem 1.5rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--step-0);
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--btn-bg);
  clip-path: polygon(var(--chamfer) 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%, 0 100%, 0 var(--chamfer));
  transition: background-color 0.2s ease;
}
.btn--primary { --btn-bg: var(--teal); color: var(--night); }
.btn--primary:hover { --btn-bg: #67b29e; }
.btn--ghost { --btn-bg: rgba(225, 229, 239, 0.12); color: var(--mist); }
.btn--ghost:hover { --btn-bg: rgba(225, 229, 239, 0.2); }
.btn--solid { --btn-bg: var(--navy); color: #fff; }
.btn--solid:hover { --btn-bg: #34489c; }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }

/* Header */
.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 50;
  height: var(--header-h);
  color: var(--mist);
  --wordmark: var(--mist);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}
.site-header.is-solid {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(10px);
  color: var(--text);
  --wordmark: var(--wordmark-solid);
  box-shadow: 0 1px 0 var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  height: 100%;
}

.brand {
  display: block;
  flex: none;
  width: clamp(9.5rem, 16vw, 11.5rem);
  margin-inline-end: auto;
  direction: ltr;
}
.brand svg { width: 100%; height: auto; overflow: visible; }
.brand .lg-word path { fill: var(--wordmark); transition: fill 0.3s ease; }

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav a {
  font-size: var(--step--1);
  font-weight: 400;
  text-decoration: none;
  opacity: 0.88;
}
.nav a:hover { opacity: 1; text-decoration: underline; }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid currentColor;
  border-radius: 2rem;
  font-size: var(--step--1);
  font-weight: 500;
  text-decoration: none;
  opacity: 0.9;
}
.lang-switch:hover { opacity: 1; }
.lang-switch svg { width: 1rem; height: 1rem; }
.lang-switch [lang="ar"] { font-size: 1.05em; }

.header-cta { min-height: 2.75rem; padding-inline: 1.15rem; font-size: var(--step--1); }

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.menu-toggle svg { width: 1.2rem; height: 1.2rem; }
.menu-toggle .icon-close { display: none; }
.menu-toggle[aria-expanded="true"] .icon-open { display: none; }
.menu-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 960px) {
  .menu-toggle { display: inline-flex; }
  .header-cta { display: none; }
  .nav {
    position: fixed;
    inset-block-start: var(--header-h);
    inset-inline: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--night);
    color: var(--mist);
    border-block-start: 1px solid rgba(225, 229, 239, 0.12);
    transform: translateY(-0.5rem);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: none; }
  .nav a {
    padding-block: 0.9rem;
    font-size: var(--step-1);
    border-block-end: 1px solid rgba(225, 229, 239, 0.1);
  }
  .nav .btn { margin-block-start: 1.25rem; font-size: var(--step-0); }
}
@media (min-width: 961px) { .nav .btn { display: none; } }

@media (max-width: 420px) {
  .lang-switch { padding-inline: 0.7rem; }
  .lang-switch svg { display: none; }
}

/* Logo animation: the hexagon is drawn, the bolt powers on, the wordmark settles in.
   Plays once on load and again on hover. */
.lg-hex-line { fill: none; stroke: var(--teal); stroke-width: 3; opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .brand.is-playing .lg-hex-line {
    opacity: 1;
    stroke-dasharray: 1;
    animation: lg-draw 0.7s cubic-bezier(0.6, 0, 0.3, 1) both, lg-fade-out 0.3s 0.75s ease both;
  }
  .brand.is-playing .lg-hex { animation: lg-fill 0.45s 0.45s ease both; }
  .brand.is-playing .lg-cut { animation: lg-fill 0.3s 0.75s ease both; }
  .brand.is-playing .lg-bolt { animation: lg-strike 0.5s 0.7s steps(1, end) both, lg-drop 0.35s 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .brand.is-playing .lg-word path {
    animation: lg-letter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: calc(0.85s + var(--i) * 0.045s);
  }
}
@keyframes lg-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes lg-fade-out { to { opacity: 0; } }
@keyframes lg-fill { from { opacity: 0; } to { opacity: 1; } }
@keyframes lg-strike {
  0% { opacity: 0; }
  20% { opacity: 1; }
  35% { opacity: 0.25; }
  50% { opacity: 1; }
  62% { opacity: 0.5; }
  75%, 100% { opacity: 1; }
}
@keyframes lg-drop { from { transform: translateY(-14px); } to { transform: none; } }
@keyframes lg-letter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.lg-word path { transform-box: fill-box; }

/* Hero
   The photo sits on the inline-end side and dissolves into a solid night panel,
   so the headline always reads on a clean, dark background. */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: max(38rem, min(100svh, 56rem));
  color: var(--mist);
  background: var(--night);
  overflow: hidden;
  isolation: isolate;
}
.hero__media {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 64%;
  z-index: -2;
  -webkit-mask-image: linear-gradient(to left, #000 45%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
  mask-image: linear-gradient(to left, #000 45%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
}
[dir="rtl"] .hero__media {
  -webkit-mask-image: linear-gradient(to right, #000 45%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
  mask-image: linear-gradient(to right, #000 45%, rgba(0, 0, 0, 0.55) 70%, transparent 100%);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% 72%;
  filter: saturate(1.1) contrast(1.05);
}
/* Navy wash and a soft top shade for the header */
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(14, 22, 51, 0.65), rgba(14, 22, 51, 0) 24%, rgba(14, 22, 51, 0) 76%, rgba(14, 22, 51, 0.6)),
    rgba(44, 62, 138, 0.18);
  mix-blend-mode: multiply;
}
/* Hexagon lattice on the text side, fading out toward the photo */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--lattice-light);
  background-size: 38.1px 66px;
  -webkit-mask-image: linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.4) 35%, transparent 55%);
  mask-image: linear-gradient(to right, #000 0%, rgba(0, 0, 0, 0.4) 35%, transparent 55%);
  pointer-events: none;
}
[dir="rtl"] .hero::before {
  -webkit-mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0.4) 35%, transparent 55%);
  mask-image: linear-gradient(to left, #000 0%, rgba(0, 0, 0, 0.4) 35%, transparent 55%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.16;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero__content {
  position: relative;
  padding-block: calc(var(--header-h) + 2.5rem) clamp(3rem, 7vw, 5rem);
}
.hero__content > * { max-width: 36rem; }
.hero h1 {
  font-size: clamp(2.3rem, 1.5rem + 3.3vw, 4.1rem);
  font-weight: 600;
  line-height: 1.05;
}
:lang(ar) .hero h1 { line-height: 1.35; }
.hero__lede {
  margin-block-start: 1.5rem;
  font-size: var(--step-1);
  color: rgba(225, 229, 239, 0.84);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-block-start: 2.25rem;
}

@media (prefers-reduced-motion: no-preference) {
  .hero__media img { animation: settle 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .hero__content > * { animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
  .hero__content > :nth-child(1) { animation-delay: 0.9s; }
  .hero__content > :nth-child(2) { animation-delay: 1.05s; }
  .hero__content > :nth-child(3) { animation-delay: 1.2s; }
}
@keyframes settle { from { opacity: 0; transform: scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Small screens: the photo sits at the top and fades down into the text panel */
@media (max-width: 820px) {
  .hero { align-items: end; min-height: max(40rem, 100svh); }
  .hero__media,
  [dir="rtl"] .hero__media {
    inset-inline: 0;
    inset-block: 0 auto;
    width: 100%;
    height: 58%;
    -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  }
  .hero__media img { object-position: 45% 70%; }
  .hero::before,
  [dir="rtl"] .hero::before {
    -webkit-mask-image: linear-gradient(to top, #000 0%, transparent 45%);
    mask-image: linear-gradient(to top, #000 0%, transparent 45%);
  }
  .hero__content { padding-block-start: 0; }
}

/* Sections */
.section { position: relative; padding-block: var(--section); }
.section--alt { background: var(--surface-2); }
.section--night { background: var(--night); color: var(--mist); }
.section--night p { color: rgba(225, 229, 239, 0.78); }

.texture-lattice::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--lattice-light);
  background-size: 38.1px 66px;
  -webkit-mask-image: radial-gradient(120% 90% at var(--lattice-at, 100% 0%), #000 0%, transparent 70%);
  mask-image: radial-gradient(120% 90% at var(--lattice-at, 100% 0%), #000 0%, transparent 70%);
  pointer-events: none;
}
.texture-lattice--ink::before { background-image: var(--lattice-dark); }
[dir="rtl"] .texture-lattice { --lattice-at: 0% 0%; }
.texture-lattice > * { position: relative; }

.texture-grain::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--grain);
  opacity: 0.06;
  pointer-events: none;
}
.section--night.texture-grain::after { opacity: 0.12; mix-blend-mode: overlay; }

.section-head { max-width: 40rem; margin-block-end: clamp(2.5rem, 5vw, 4rem); }
.section-head h2 { font-size: var(--step-3); }
.section-head p { margin-block-start: 1rem; font-size: var(--step-1); color: var(--text-muted); }
.section--night .section-head p { color: rgba(225, 229, 239, 0.75); }

/* About */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}
.about h2 { font-size: var(--step-3); max-width: 18ch; }
.about__body p { max-width: 60ch; margin-block-start: 1.25rem; color: var(--text-muted); }
.about__body p:first-of-type { color: var(--text); font-size: var(--step-1); font-weight: 300; }

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

.steps-title { font-size: var(--step-1); font-weight: 500; margin-block-end: 1.5rem; }
.steps {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps::before {
  content: "";
  position: absolute;
  inset-block: 1.6rem 1.6rem;
  inset-inline-start: calc(1.6rem - 0.5px);
  border-inline-start: 1px dashed color-mix(in srgb, var(--teal) 60%, transparent);
}
.steps li {
  position: relative;
  display: grid;
  grid-template-columns: 3.2rem 1fr;
  gap: 1.1rem;
  padding-block-end: 1.75rem;
  counter-increment: step;
}
.steps li:last-child { padding-block-end: 0; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 3.2rem;
  aspect-ratio: 126.29 / 139.68;
  background: var(--navy);
  color: #fff;
  font-weight: 500;
  -webkit-mask: var(--hex) center / contain no-repeat;
  mask: var(--hex) center / contain no-repeat;
}
:lang(ar) .steps li::before { content: counter(step, arabic-indic); }
.steps h3 { margin: 0.35rem 0 0.25rem; font-size: var(--step-1); font-weight: 500; }
.steps p { color: var(--text-muted); font-size: var(--step-0); }

/* Services: tab index on wide screens, scrollable chips on small screens */
.services {
  display: grid;
  grid-template-columns: minmax(15rem, 22rem) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: start;
}
.service-tabs {
  display: flex;
  flex-direction: column;
  border-inline-start: 1px solid var(--line);
}
.service-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1.1rem;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
  font-weight: 400;
  text-align: start;
  cursor: pointer;
  transition: color 0.2s ease;
}
.service-tab svg { width: 1.35rem; height: 1.35rem; flex: none; }
.service-tab:hover { color: var(--text); }
.service-tab[aria-selected="true"] { color: var(--text); font-weight: 500; }
.service-tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  inset-block: 0.4rem;
  inset-inline-start: -1px;
  width: 3px;
  background: var(--teal);
}
.service-tab:focus-visible { outline-offset: -2px; }

.service-panel { position: relative; }
.service-panel__inner {
  position: relative;
  isolation: isolate;
  padding: clamp(1.75rem, 4vw, 3.25rem);
  min-height: 100%;
}
.service-panel__inner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  clip-path: polygon(0 0, calc(100% - 2.25rem) 0, 100% 2.25rem, 100% 100%, 0 100%);
}
[dir="rtl"] .service-panel__inner::before {
  clip-path: polygon(2.25rem 0, 100% 0, 100% 100%, 0 100%, 0 2.25rem);
}
.service-icon {
  display: grid;
  place-items: center;
  width: 4.2rem;
  aspect-ratio: 126.29 / 139.68;
  margin-block-end: 1.5rem;
  background: var(--navy);
  color: #fff;
  -webkit-mask: var(--hex) center / contain no-repeat;
  mask: var(--hex) center / contain no-repeat;
}
.service-icon svg { width: 1.9rem; height: 1.9rem; }
.service-panel h3 { font-size: var(--step-2); }
.service-panel p { max-width: 56ch; margin-block-start: 1rem; font-size: var(--step-1); color: var(--text-muted); }
.service-panel h4 { margin: 2rem 0 0.75rem; font-size: var(--step--1); font-weight: 500; color: var(--accent-ink); }
.service-panel ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.service-panel li {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  font-size: var(--step--1);
}
.service-panel .btn { margin-block-start: 2.25rem; }

@media (max-width: 820px) {
  .services { grid-template-columns: 1fr; }
  .service-tabs {
    flex-direction: row;
    gap: 0.5rem;
    margin-inline: calc(-1 * var(--gutter));
    padding-inline: var(--gutter);
    padding-block-end: 0.5rem;
    border: 0;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .service-tabs::-webkit-scrollbar { display: none; }
  .service-tab {
    flex: none;
    scroll-snap-align: start;
    padding: 0.55rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 2rem;
    font-size: var(--step--1);
    white-space: nowrap;
  }
  .service-tab svg { width: 1.1rem; height: 1.1rem; }
  .service-tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
  .service-tab[aria-selected="true"]::before { display: none; }
}

/* Sectors */
.sectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sectors li {
  padding-block: 1.6rem 1.9rem;
  border-block-start: 1px solid rgba(225, 229, 239, 0.16);
}
.sectors h3 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: var(--step-1);
  font-weight: 500;
}
.sectors h3::before {
  content: "";
  flex: none;
  width: 0.8rem;
  aspect-ratio: 126.29 / 139.68;
  background: var(--teal);
  -webkit-mask: var(--hex) center / contain no-repeat;
  mask: var(--hex) center / contain no-repeat;
}
.sectors p { margin-block-start: 0.6rem; font-size: var(--step-0); }
@media (max-width: 900px) { .sectors { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .sectors { grid-template-columns: 1fr; } }

/* Brands */
.brands {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.brands h2 { font-size: var(--step-2); }
.brands p { margin-block-start: 0.9rem; color: var(--text-muted); max-width: 42ch; }
.brand-logos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  direction: ltr;
  border-block-start: 1px solid var(--line);
  border-inline-start: 1px solid var(--line);
}
.brand-logos li {
  display: grid;
  place-items: center;
  min-height: 7.5rem;
  padding: 1.25rem;
  border-block-end: 1px solid var(--line);
  border-inline-end: 1px solid var(--line);
}
.brand-logos img {
  width: var(--w);
  max-width: 100%;
  height: auto;
  /* One ink colour so mixed brand palettes sit quietly together */
  filter: brightness(0);
  opacity: 0.62;
  transition: filter 0.3s ease, opacity 0.3s ease;
}
.brand-logos li:hover img { filter: none; opacity: 1; }
@media (prefers-color-scheme: dark) {
  .brand-logos img { filter: brightness(0) invert(1); opacity: 0.7; }
  .brand-logos li:hover img { filter: brightness(0) invert(1); opacity: 1; }
}
@media (max-width: 560px) {
  .brand-logos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-logos li { min-height: 6rem; padding: 1rem; }
  .brand-logos img { width: calc(var(--w) * 0.8); }
}
@media (max-width: 820px) { .brands { grid-template-columns: 1fr; } }

/* FAQ */
.faq {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.faq .section-head { margin: 0; position: sticky; inset-block-start: calc(var(--header-h) + 2rem); }
.faq details { border-block-end: 1px solid var(--line); }
.faq details:first-child { border-block-start: 1px solid var(--line); }
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.35rem;
  font-size: var(--step-1);
  font-weight: 500;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 1.4rem;
  height: 1.4rem;
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 100% no-repeat;
  color: var(--accent-ink);
  transition: transform 0.25s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { max-width: 62ch; padding-block-end: 1.5rem; color: var(--text-muted); }
@media (max-width: 860px) {
  .faq { grid-template-columns: 1fr; }
  .faq .section-head { position: static; }
}

/* Contact */
.contact {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.contact h2 { font-size: var(--step-3); }
.contact__intro { margin-block-start: 1rem; font-size: var(--step-1); }
.contact-list { margin: 2.5rem 0 0; padding: 0; display: grid; gap: 1.35rem; }
.contact-list div { display: grid; gap: 0.15rem; }
.contact-list dt { font-size: var(--step--1); color: var(--teal); font-weight: 500; }
.contact-list dd { margin: 0; color: var(--mist); }
.contact-list a { text-decoration: none; }
.contact-list a:hover { text-decoration: underline; }

.form {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  color: var(--text);
}
.form::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--surface);
  clip-path: polygon(0 0, calc(100% - 2.25rem) 0, 100% 2.25rem, 100% 100%, 0 100%);
}
[dir="rtl"] .form::before { clip-path: polygon(2.25rem 0, 100% 0, 100% 100%, 0 100%, 0 2.25rem); }
.field { display: grid; gap: 0.4rem; align-content: start; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: var(--step--1); font-weight: 500; }
.field .optional { font-weight: 300; color: var(--text-muted); }
.field .hint { font-size: var(--step--1); color: var(--text-muted); }
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--text) 24%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--surface-2) 40%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: var(--step-0);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field select {
  appearance: none;
  height: 3rem;
  padding-inline-end: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23549d8a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 1.1rem;
  background-position: right 0.85rem center;
}
[dir="rtl"] .field select { background-position: left 0.85rem center; }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { outline-offset: 0; border-color: var(--teal); }
.field input:user-invalid,
.field select:user-invalid { border-color: #c2413a; }
.field input[type="tel"],
.field input[type="email"] { direction: ltr; }
[dir="rtl"] .field input[type="tel"],
[dir="rtl"] .field input[type="email"] { text-align: right; }
.form .btn { justify-self: start; margin-block-start: 0.5rem; }
.form__status { grid-column: 1 / -1; font-size: var(--step--1); color: var(--accent-ink); min-height: 1.5em; }
@media (max-width: 900px) { .contact { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .form { grid-template-columns: 1fr; } }

/* Footer */
.site-footer {
  position: relative;
  padding-block: clamp(3.5rem, 7vw, 5.5rem) 2rem;
  background: color-mix(in srgb, var(--night) 78%, #000);
  color: rgba(225, 229, 239, 0.78);
  font-size: var(--step--1);
  border-block-start: 1px solid rgba(225, 229, 239, 0.08);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 2.5rem;
}
.footer-brand img { width: 11rem; }
.footer-brand p { margin-block-start: 1.25rem; max-width: 34ch; }
.site-footer h2 { font-size: var(--step-0); font-weight: 500; color: var(--mist); margin-block-end: 1rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.55rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--mist); text-decoration: underline; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-block-start: 3.5rem;
  padding-block-start: 1.5rem;
  border-block-start: 1px solid rgba(225, 229, 239, 0.12);
}
.footer-credit { direction: ltr; }
.credits a { color: var(--mist); text-decoration: underline; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* Go to top: the logo hexagon, with its outline tracing scroll progress */
.to-top {
  position: fixed;
  inset-block-end: clamp(1rem, 3vw, 1.75rem);
  inset-inline-end: clamp(1rem, 3vw, 1.75rem);
  z-index: 40;
  display: grid;
  place-items: center;
  width: 3.4rem;
  height: 3.76rem;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.75rem);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top svg.frame { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.to-top .frame-fill { fill: var(--navy); transition: fill 0.2s ease; }
.to-top:hover .frame-fill { fill: #34489c; }
.to-top .frame-track { fill: none; stroke: rgba(225, 229, 239, 0.25); stroke-width: 6; }
.to-top .frame-progress { fill: none; stroke: var(--teal); stroke-width: 6; stroke-dasharray: 1; stroke-dashoffset: 0; }
.to-top .arrow { position: relative; width: 1.2rem; height: 1.2rem; }

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    .to-top .frame-progress {
      animation: trace linear both;
      animation-timeline: scroll(root block);
    }
  }
}
@keyframes trace { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
