/* ELVARIS SOFTWARE LTD — components.css */

/* ================= LOGO ================= */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.62em;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
  transition: color var(--dur-mid) var(--ease-out);
}

.logo svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  overflow: visible;
}

.logo .wordmark {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.24rem;
  letter-spacing: 0.09em;
  line-height: 1;
  color: inherit;
  transition: color var(--dur-mid) var(--ease-out);
}

/* Route strokes animate subtly on hover */
.logo .route-mid { transition: transform var(--dur-mid) var(--ease-out); }
.logo:hover .route-mid { transform: translateX(2px); }
.logo .route-node { transition: transform var(--dur-mid) var(--ease-out); transform-origin: center; }
.logo:hover .route-node { transform: scale(1.22); }

/* ================= BUTTONS ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  font-weight: 600;
  font-size: 0.93rem;
  letter-spacing: -0.005em;
  padding: 0.9em 1.7em;
  border-radius: 999px;
  border: 1.5px solid transparent;
  text-decoration: none;
  cursor: pointer;
  min-height: 48px;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out),
              background var(--dur-fast), border-color var(--dur-fast),
              color var(--dur-fast), box-shadow var(--dur-mid);
  white-space: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}
.btn-primary:hover {
  background: var(--cobalt-dark);
  border-color: var(--cobalt-dark);
  color: var(--white);
  box-shadow: var(--shadow-m);
}

.btn-accent {
  background: var(--cobalt);
  color: var(--white);
  border-color: var(--cobalt);
}
.btn-accent:hover {
  background: var(--cobalt-dark);
  border-color: var(--cobalt-dark);
  box-shadow: 0 16px 34px -18px rgba(47, 85, 240, 0.75);
}

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: color-mix(in srgb, var(--ink) 30%, transparent);
}
.btn-outline:hover {
  background: var(--ink);
  color: var(--ivory);
  border-color: var(--ink);
}

.btn-light {
  background: rgba(246, 243, 236, 0.1);
  color: var(--white);
  border-color: rgba(246, 243, 236, 0.34);
  backdrop-filter: blur(8px);
}
.btn-light:hover { background: var(--white); color: var(--ink); border-color: var(--white); }

.btn-ghost {
  background: transparent;
  color: var(--cobalt-dark);
  border-color: transparent;
  padding-inline: 0.2em;
  min-height: 40px;
}
.on-dark .btn-ghost { color: var(--luminous); }

/* animated arrow link */
.btn-ghost .arrow,
.link-arrow .arrow {
  display: inline-block;
  transition: transform var(--dur-mid) var(--ease-out);
}
.btn-ghost:hover .arrow,
.link-arrow:hover .arrow { transform: translateX(5px); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--cobalt-dark);
  position: relative;
  padding-bottom: 0.2em;
}
.link-arrow::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-mid) var(--ease-out);
}
.link-arrow:hover::after { transform: scaleX(1); }
.on-dark .link-arrow { color: var(--luminous); }

.btn-sm { padding: 0.58em 1.2em; font-size: 0.855rem; min-height: 40px; }
.btn-block { width: 100%; }

.cta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; align-items: center; }

/* ================= MENU TOGGLE ================= */
.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6em;
  background: var(--ink);
  color: var(--ivory);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.55em 1.05em;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--dur-mid), color var(--dur-mid), border-color var(--dur-mid);
}

.menu-toggle .bar {
  display: block;
  width: 18px; height: 1.6px;
  background: currentColor;
  position: relative;
}
.menu-toggle .bar::before,
.menu-toggle .bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px; height: 1.6px;
  background: currentColor;
}
.menu-toggle .bar::before { top: -5.5px; }
.menu-toggle .bar::after { top: 5.5px; width: 12px; }

/* ================= MOBILE MENU ================= */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: var(--ivory);
  transform: translateY(-101%);
  transition: transform var(--dur-slow) var(--ease-in-out);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-menu.is-open { transform: translateY(0); }

.mobile-menu__bar {
  height: 4px;
  background: linear-gradient(90deg, var(--cobalt), var(--violet) 45%, var(--vermilion));
  flex-shrink: 0;
}

.mobile-menu__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem clamp(1.25rem, 4vw, 3.25rem);
  border-bottom: 1px solid rgba(14,16,22,0.08);
}

.mobile-menu__close {
  background: var(--ink);
  color: var(--ivory);
  border: none;
  border-radius: 999px;
  width: 46px; height: 46px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu__list {
  list-style: none;
  margin: 0;
  padding: 0.5rem clamp(1.25rem, 4vw, 3.25rem) 1rem;
  max-width: none;
}
.mobile-menu__list li { border-bottom: 1px solid rgba(14,16,22,0.08); margin: 0; }

.mobile-menu__list a {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.95rem 0;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color var(--dur-fast), padding-left var(--dur-mid) var(--ease-out);
}
.mobile-menu__list a:hover { color: var(--cobalt-dark); padding-left: 0.4rem; }
.mobile-menu__list a .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 500;
}

/* domain shortcuts */
.mobile-menu__domains {
  padding: 1.25rem clamp(1.25rem, 4vw, 3.25rem);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.mobile-menu__domains a {
  display: block;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(14,16,22,0.12);
  border-radius: var(--radius-m);
  text-decoration: none;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  border-left: 3px solid var(--dc, var(--cobalt));
}
.mobile-menu__domains a:hover { background: var(--white); }

.mobile-menu__foot {
  margin-top: auto;
  padding: 1.4rem clamp(1.25rem, 4vw, 3.25rem) 2.25rem;
  border-top: 1px solid rgba(14,16,22,0.08);
  font-size: 0.94rem;
  background: var(--bone);
}
.mobile-menu__foot a { color: var(--ink); font-weight: 600; text-decoration: none; }
.mobile-menu__foot p { margin: 0 0 0.45em; max-width: none; }

/* ================= CARDS / TILES ================= */
.card {
  background: var(--white);
  border-radius: var(--radius-l);
  border: 1px solid rgba(14,16,22,0.08);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  min-width: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--pale-blue);
  color: var(--cobalt-dark);
  padding: 0.42em 0.85em;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}
.badge--vermilion { background: #FDE1D9; color: #A8371C; }
.badge--violet { background: #E7E3FC; color: #4A3BC0; }
.badge--sand { background: var(--sand); color: #5A4B33; }
.badge--dark { background: rgba(246,243,236,0.12); color: var(--luminous); }

.meta-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-bottom: 1rem; }

.tile {
  padding: clamp(1.4rem, 2.4vw, 1.9rem);
  border-radius: var(--radius-m);
  background: var(--white);
  border: 1px solid rgba(14,16,22,0.08);
  min-width: 0;
  position: relative;
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid);
}
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.tile h3 { margin-bottom: 0.4em; }
.tile p { font-size: 0.94rem; color: var(--graphite); margin-bottom: 0; }

.tile .tile-num {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.9em;
  display: block;
}

.on-dark .tile {
  background: rgba(246, 243, 236, 0.045);
  border-color: rgba(246, 243, 236, 0.12);
}
.on-dark .tile p { color: rgba(246,243,236,0.7); }
.on-dark .tile .tile-num { color: var(--luminous); }

/* ================= SERVICE CARDS ================= */
.service-card {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(14,16,22,0.08);
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  transition: transform var(--dur-mid) var(--ease-out), box-shadow var(--dur-mid), border-color var(--dur-mid);
}

.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-l);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
}

.service-card[class*="accent-cat"]::before {
  content: "";
  display: block;
  height: 4px;
  background: var(--accent);
  position: relative;
  z-index: 2;
}

.service-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--grey);
}

.service-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 900ms var(--ease-out);
}
.service-card:hover .service-card__media img { transform: scale(1.055); }

.service-card__number {
  position: absolute;
  top: 0.9rem; left: 0.9rem;
  background: rgba(14,16,22,0.72);
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.35em 0.75em;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  z-index: 2;
}

.service-card__body {
  padding: clamp(1.3rem, 2.4vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  flex: 1;
  min-width: 0;
}

.service-card__title { font-size: clamp(1.1rem, 1.5vw, 1.3rem); margin-bottom: 0; }
.service-card__desc { color: var(--graphite); font-size: 0.94rem; max-width: 46ch; margin: 0; }

.service-card__facts {
  display: flex;
  gap: 1.1rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--graphite);
  flex-wrap: wrap;
  padding-top: 0.2rem;
}
.service-card__facts span { display: inline-flex; align-items: center; gap: 0.4em; }
.service-card__facts span::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.service-card__actions {
  display: flex;
  gap: 0.65rem;
  margin-top: auto;
  padding-top: 0.75rem;
  flex-wrap: wrap;
}

/* --- Featured: overlaid information on large image --- */
.service-card--featured {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.service-card--featured .service-card__media { aspect-ratio: auto; height: 100%; min-height: 320px; }
.service-card--featured .service-card__body { padding: clamp(1.75rem, 3.2vw, 2.75rem); justify-content: center; }
.service-card--featured .service-card__title { font-size: clamp(1.45rem, 2.5vw, 2.05rem); }
.service-card--featured .service-card__desc { font-size: 1rem; }

@media (max-width: 760px) {
  .service-card--featured { grid-template-columns: minmax(0, 1fr); }
  .service-card--featured .service-card__media { min-height: 230px; }
}

/* --- Overlay variant: text sits on the image --- */
.service-card--overlay {
  min-height: clamp(340px, 42vw, 460px);
  justify-content: flex-end;
}
.service-card--overlay .service-card__media {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}
/* Two-axis veil: the vertical pass darkens the lower band where the copy sits,
   the horizontal pass protects the text column against bright image detail. */
.service-card--overlay .service-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14,16,22,0.10) 0%, rgba(14,16,22,0.62) 48%, rgba(14,16,22,0.94) 100%),
    linear-gradient(90deg, rgba(14,16,22,0.82) 0%, rgba(14,16,22,0.45) 46%, rgba(14,16,22,0.05) 100%);
}
.service-card--overlay .service-card__body {
  position: relative;
  z-index: 2;
  color: var(--ivory);
  max-width: 60ch;
}
.service-card--overlay .service-card__title { color: var(--white); }
.service-card--overlay .service-card__desc { color: rgba(246,243,236,0.8); }
.service-card--overlay .service-card__facts { color: rgba(246,243,236,0.75); }

/* --- Row: horizontal split --- */
.service-card--row { display: grid; grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
.service-card--row .service-card__media { aspect-ratio: auto; height: 100%; min-height: 200px; }

@media (max-width: 660px) {
  .service-card--row { grid-template-columns: minmax(0, 1fr); }
  .service-card--row .service-card__media { aspect-ratio: 16/9; min-height: 0; }
}

/* --- Row reverse (alternating direction) --- */
.service-card--row-rev { grid-template-columns: minmax(0, 1fr) minmax(0, 240px); }
.service-card--row-rev .service-card__media { order: 2; }
@media (max-width: 660px) {
  .service-card--row-rev { grid-template-columns: minmax(0, 1fr); }
  .service-card--row-rev .service-card__media { order: 0; aspect-ratio: 16/9; min-height: 0; }
}

.service-card--compact .service-card__body { padding: 1.15rem 1.35rem; gap: 0.5rem; }
.service-card--compact .service-card__title { font-size: 1.02rem; }
.service-card--compact .service-card__desc { font-size: 0.87rem; }

/* Category accent tokens */
.accent-cat-1 { --accent: var(--category-1); }
.accent-cat-2 { --accent: var(--category-2); }
.accent-cat-3 { --accent: var(--category-3); }
.accent-cat-4 { --accent: var(--category-4); }

/* ================= BREADCRUMBS ================= */
.breadcrumbs {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--slate);
  padding-block: 1.35rem;
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  padding: 0; margin: 0;
  max-width: none;
}
.breadcrumbs li { margin: 0; }
.breadcrumbs a { color: var(--slate); text-decoration: none; }
.breadcrumbs a:hover { color: var(--cobalt-dark); text-decoration: underline; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 0.45em; opacity: 0.45; }
.on-dark .breadcrumbs, .on-dark .breadcrumbs a { color: rgba(246,243,236,0.6); }

/* ================= ACCORDION ================= */
.accordion { border-top: 1px solid rgba(14,16,22,0.13); }
.accordion-item { border-bottom: 1px solid rgba(14,16,22,0.13); }

.accordion-trigger {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.25rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: -0.012em;
  transition: color var(--dur-fast);
}
.accordion-trigger:hover { color: var(--cobalt-dark); }

.accordion-trigger .icon {
  flex-shrink: 0;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.4px solid currentColor;
  position: relative;
}
.accordion-trigger .icon::before,
.accordion-trigger .icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
.accordion-trigger .icon::before { width: 11px; height: 1.6px; }
.accordion-trigger .icon::after { width: 1.6px; height: 11px; transition: transform var(--dur-fast); }
.accordion-trigger[aria-expanded="true"] .icon::after { transform: translate(-50%, -50%) rotate(90deg) scale(0); }

.accordion-panel {
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--dur-mid) var(--ease-in-out);
}
.accordion-panel > div { padding-bottom: 1.35rem; }
.accordion-panel p { margin-bottom: 0; color: var(--graphite); }
.accordion-item[data-open="true"] .accordion-panel { max-height: 900px; }
.no-js .accordion-panel { max-height: none !important; }

/* ================= FORMS ================= */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.3rem;
}
.form-field { min-width: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.form-field--full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 0.88rem; }
.form-field .hint { font-size: 0.79rem; color: var(--slate); }

.form-field input,
.form-field select,
.form-field textarea {
  font-family: inherit;
  font-size: 0.97rem;
  padding: 0.78em 0.9em;
  border-radius: var(--radius-s);
  border: 1.5px solid rgba(14,16,22,0.2);
  background: var(--white);
  color: var(--ink);
  width: 100%;
  min-height: 48px;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.form-field textarea { min-height: 140px; resize: vertical; }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--cobalt);
  box-shadow: 0 0 0 3px rgba(47, 85, 240, 0.13);
  outline: none;
}

.form-field.has-error input,
.form-field.has-error select,
.form-field.has-error textarea { border-color: var(--vermilion); }

.form-error { color: #A8371C; font-size: 0.82rem; display: none; }
.form-field.has-error .form-error { display: block; }

.form-checkbox { display: flex; align-items: flex-start; gap: 0.7em; }
.form-checkbox input {
  width: 20px; height: 20px;
  min-height: unset;
  margin-top: 0.22em;
  flex-shrink: 0;
  accent-color: var(--cobalt);
}
.form-checkbox label { font-weight: 400; font-size: 0.92rem; line-height: 1.5; }

.honeypot-field {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-status {
  padding: 1rem 1.2rem;
  border-radius: var(--radius-s);
  background: var(--pale-blue);
  color: var(--cobalt-dark);
  font-weight: 600;
  font-size: 0.93rem;
  display: none;
  margin-bottom: 1.25rem;
}
.form-status.is-visible { display: block; }
.form-status.is-error { background: #FDE1D9; color: #A8371C; }

/* ================= TABLES ================= */
.matrix-table {
  width: 100%;
  border: 1px solid rgba(14,16,22,0.13);
  border-radius: var(--radius-m);
  overflow: hidden;
  font-size: 0.91rem;
}
.matrix-table th,
.matrix-table td {
  text-align: left;
  padding: 0.95rem 1.15rem;
  border-bottom: 1px solid rgba(14,16,22,0.09);
  vertical-align: top;
}
.matrix-table thead th {
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 500;
}
.matrix-table tbody tr:last-child td { border-bottom: none; }
.matrix-table tbody tr:nth-child(even) { background: rgba(230, 227, 220, 0.42); }
.matrix-table tbody tr { transition: background var(--dur-fast); }
.matrix-table tbody tr:hover { background: var(--pale-blue); }

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-m);
}

/* ================= COOKIE BANNER ================= */
.cookie-banner {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  max-width: 540px;
  z-index: 800;
  background: var(--midnight);
  color: rgba(246,243,236,0.85);
  border: 1px solid rgba(246,243,236,0.12);
  border-radius: var(--radius-m);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-l);
  transform: translateY(150%);
  transition: transform var(--dur-slow) var(--ease-out);
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner p { color: rgba(246,243,236,0.8); font-size: 0.88rem; max-width: none; margin-bottom: 0; }
.cookie-banner a { color: var(--luminous); }
.cookie-banner__actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.cookie-banner .btn-outline { color: var(--ivory); border-color: rgba(246,243,236,0.4); }
.cookie-banner .btn-outline:hover { background: var(--ivory); color: var(--ink); }
.cookie-banner .btn-ghost { color: var(--luminous); }

.cookie-details {
  margin-top: 0.9rem;
  font-size: 0.84rem;
  color: rgba(246,243,236,0.68);
  display: none;
  line-height: 1.6;
}
.cookie-details.is-visible { display: block; }

/* ================= MISC ================= */
.pill-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(14,16,22,0.18);
  border-radius: 999px;
  padding: 0.42em 0.95em;
  transition: border-color var(--dur-fast), color var(--dur-fast);
}
.pill-link:hover { border-color: var(--cobalt); color: var(--cobalt-dark); }

.rule {
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border: none;
  margin: 0 0 1.5rem;
  max-width: 180px;
}

/* ================= REVEAL SYSTEM =================
   Content is NEVER hidden by opacity — only offset, so a failed
   observer or missing JS can never make copy unreadable. */
[data-reveal] { opacity: 1; transform: none; }

.js [data-reveal] {
  transform: translateY(18px);
  transition: transform var(--dur-slow) var(--ease-out);
}
.js [data-reveal].is-visible { transform: none; }

/* Staggered children */
.js [data-stagger] > * {
  transform: translateY(16px);
  transition: transform var(--dur-slow) var(--ease-out);
}
.js [data-stagger].is-visible > * { transform: none; }
.js [data-stagger].is-visible > *:nth-child(1) { transition-delay: 0ms; }
.js [data-stagger].is-visible > *:nth-child(2) { transition-delay: 70ms; }
.js [data-stagger].is-visible > *:nth-child(3) { transition-delay: 140ms; }
.js [data-stagger].is-visible > *:nth-child(4) { transition-delay: 210ms; }
.js [data-stagger].is-visible > *:nth-child(5) { transition-delay: 280ms; }
.js [data-stagger].is-visible > *:nth-child(6) { transition-delay: 350ms; }

/* Line reveal for display headings.
   The RESTING state is fully visible and unclipped — the animation only plays
   forwards from a hidden start. If animations never run (no CSS animation
   support, a stalled compositor, reduced-motion, or a failed observer) the
   heading still reads normally. Nothing here can leave text permanently hidden. */
.mask-line { display: block; }
.mask-line > span {
  display: block;
  transform: none;
  animation: mask-rise 900ms var(--ease-out) 1 backwards;
}
.mask-line:nth-child(2) > span { animation-delay: 110ms; }
.mask-line:nth-child(3) > span { animation-delay: 220ms; }

/* Transform-only: never animates opacity, so even a frozen or never-started
   animation leaves the heading at full contrast and completely readable. */
@keyframes mask-rise {
  from { transform: translateY(24px); }
  to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .js [data-reveal],
  .js [data-stagger] > * {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .mask-line > span {
    animation: none;
    transform: none;
  }
}

/* Footer + dark-context logo colour */
.site-footer .logo,
.site-footer .logo .wordmark { color: var(--ivory); }

/* =======================================================================
   SHARED SERVICE CARD  (.svc-card)
   One maintainable component used on index, services and activity pages.
   The whole card is a click target via a stretched link; the Enquire
   control sits above it on the z-axis so it stays independently operable.
   Only ONE anchor carries the ::after overlay - no nested anchors.
   ======================================================================= */
.svc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: var(--white);
  border: 1px solid rgba(14,16,22,0.09);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-l);
  overflow: hidden;
  transition: transform var(--dur-mid) var(--ease-out),
              box-shadow var(--dur-mid) var(--ease-out),
              border-color var(--dur-mid);
}

.svc-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-l);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Keyboard focus is shown on the CARD, not just the inner link */
.svc-card:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 32%, transparent), var(--shadow-m);
}
.svc-card__link:focus-visible { outline: none; }

/* ---- Media ---- */
.svc-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--grey);
  flex-shrink: 0;
}
.svc-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--img-pos, center 42%);
  transition: transform 900ms var(--ease-out);
}
.svc-card:hover .svc-card__media img { transform: scale(1.05); }

.svc-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,16,22,0.32) 0%, rgba(14,16,22,0.06) 44%, transparent 100%);
  pointer-events: none;
}

.svc-card__num {
  position: absolute;
  top: 0.85rem; left: 0.85rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--white);
  background: color-mix(in srgb, var(--accent) 88%, black);
  padding: 0.34em 0.7em;
  border-radius: 999px;
}

.svc-card__activity {
  position: absolute;
  top: 0.85rem; right: 0.85rem;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: rgba(246,243,236,0.95);
  background: rgba(14,16,22,0.68);
  backdrop-filter: blur(6px);
  padding: 0.34em 0.7em;
  border-radius: 999px;
}

/* ---- Body ---- */
.svc-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1.15rem, 2.1vw, 1.55rem);
  flex: 1 1 auto;
  min-width: 0;
}

.svc-card__cat {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.svc-card__title {
  font-size: clamp(1.05rem, 1.35vw, 1.22rem);
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.015em;
}
.svc-card__title a { color: inherit; text-decoration: none; }

/* Stretched link covering the whole card */
.svc-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.svc-card__desc {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--graphite);
  margin: 0;
  max-width: 46ch;
}

/* ---- Metadata rail ---- */
.svc-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0.35rem 0 0;
  background: rgba(14,16,22,0.1);
  border: 1px solid rgba(14,16,22,0.1);
  border-radius: var(--radius-s);
  overflow: hidden;
}
.svc-card__meta > div { background: var(--white); padding: 0.6rem 0.75rem; min-width: 0; }
.svc-card__meta dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.25em;
}
.svc-card__meta dd { margin: 0; font-weight: 650; font-size: 0.88rem; white-space: nowrap; }
.svc-card__meta .price { color: var(--accent); }

/* ---- Actions: pinned to the bottom so every card aligns ---- */
.svc-card__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
  padding: 0 clamp(1.15rem, 2.1vw, 1.55rem) clamp(1.15rem, 2.1vw, 1.55rem);
}
/* Enquire sits above the stretched link so it remains separately clickable */
.svc-card__actions .btn { position: relative; z-index: 2; }

.svc-card__view {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-weight: 650;
  font-size: 0.875rem;
  color: var(--accent);
  text-decoration: none;
}
.svc-card__view .arrow { transition: transform var(--dur-mid) var(--ease-out); display: inline-block; }
.svc-card:hover .svc-card__view .arrow { transform: translateX(5px); }

/* =======================================================================
   CATEGORY CHAPTER
   ======================================================================= */
.cat-chapter { position: relative; }

.cat-chapter__head {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  margin-bottom: clamp(1.25rem, 2.5vw, 1.85rem);
  background: var(--ink);
  isolation: isolate;
}
.cat-chapter__bg { position: absolute; inset: 0; z-index: 0; }
.cat-chapter__bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--bg-pos, center 40%);
}
.cat-chapter__bg::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(95deg, rgba(14,16,22,0.95) 0%, rgba(14,16,22,0.80) 46%, rgba(14,16,22,0.38) 100%),
    linear-gradient(180deg, transparent 34%, color-mix(in srgb, var(--accent) 38%, transparent) 100%);
}
.cat-chapter__inner {
  position: relative;
  z-index: 1;
  padding: clamp(1.5rem, 3.2vw, 2.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.cat-chapter__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  background: color-mix(in srgb, var(--accent) 85%, black);
  padding: 0.35em 0.8em;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 0.9rem;
}
.cat-chapter__head h2,
.cat-chapter__head h3 {
  color: var(--white);
  font-size: clamp(1.4rem, 2.6vw, 2.05rem);
  margin: 0 0 0.4em;
  letter-spacing: -0.02em;
}
.cat-chapter__head p {
  color: rgba(246,243,236,0.78);
  font-size: 0.94rem;
  max-width: 58ch;
  margin: 0;
}
.cat-chapter__meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: rgba(246,243,236,0.62);
  text-transform: uppercase;
  white-space: nowrap;
}

/* The two services of a category: a balanced, top-aligned pair */
.cat-chapter__services {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.1rem, 2.2vw, 1.6rem);
  align-items: stretch;
}
.cat-chapter + .cat-chapter { margin-top: clamp(2.75rem, 5.5vw, 4.5rem); }

@media (max-width: 900px) {
  .cat-chapter__services { grid-template-columns: minmax(0, 1fr); }
  .cat-chapter__inner { flex-direction: column; align-items: flex-start; }
}

/* =======================================================================
   ACTIVITY CARD - whole-card click target
   ======================================================================= */
.activity-panel { position: relative; }
.activity-panel__link { text-decoration: none; color: inherit; }
.activity-panel__link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}
.activity-panel:focus-within {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 40%, transparent), var(--shadow-m);
  border-color: var(--accent);
}
.activity-panel__link:focus-visible { outline: none; }
.activity-panel .link-arrow { position: relative; z-index: 0; }
.activity-panel:hover .link-arrow .arrow { transform: translateX(5px); }
.activity-panel:hover .link-arrow::after { transform: scaleX(1); }

/* =======================================================================
   ACTIVITY PAGE PHOTOGRAPHIC HERO (.act-hero)
   ======================================================================= */
.act-hero {
  position: relative;
  background: var(--ink);
  color: var(--ivory);
  overflow: hidden;
  isolation: isolate;
}
.act-hero__media { position: absolute; inset: 0; z-index: 0; }
.act-hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--img-pos, right 38%);
  /* Source photography is dim (mean luminance ~40-90); lift it so the
     subject actually reads through the veil instead of crushing to black. */
  filter: brightness(1.5) contrast(1.04) saturate(1.08);
}
/* The veil stays heavy over the text column and clears quickly to the right,
   so the photograph is genuinely visible instead of crushed to black. */
/* Two-layer veil.
   Layer 1 is purely HORIZONTAL, so the text column is protected at every
   height regardless of what the photograph is doing behind it.
   Layer 2 is a soft directional colour wash for mood only. */
.act-hero--dev .act-hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14,16,22,0.95) 0%, rgba(14,16,22,0.92) 34%, rgba(14,16,22,0.72) 47%, rgba(14,16,22,0.30) 63%, rgba(14,16,22,0.04) 82%, rgba(14,16,22,0) 100%),
    linear-gradient(160deg, rgba(27,55,184,0.24) 0%, rgba(14,16,22,0) 46%, rgba(27,55,184,0.20) 100%);
}
.act-hero--consult .act-hero__media::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14,16,22,0.95) 0%, rgba(14,16,22,0.92) 34%, rgba(14,16,22,0.70) 47%, rgba(14,16,22,0.28) 63%, rgba(14,16,22,0.04) 82%, rgba(14,16,22,0) 100%),
    linear-gradient(160deg, rgba(122,99,234,0.26) 0%, rgba(14,16,22,0) 46%, rgba(122,99,234,0.24) 100%);
}
/* Secondary layered crop, desktop only */
.act-hero__inset {
  position: absolute;
  z-index: 1;
  right: clamp(1.5rem, 4vw, 4rem);
  bottom: clamp(1.5rem, 4vw, 3rem);
  width: clamp(160px, 20vw, 260px);
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-m);
  overflow: hidden;
  border: 1px solid rgba(246,243,236,0.22);
  box-shadow: var(--shadow-l);
}
.act-hero__inset img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 42%;
  filter: brightness(1.28) contrast(1.05) saturate(1.06);
}
@media (max-width: 1100px) { .act-hero__inset { display: none; } }

.act-hero__inner {
  position: relative;
  z-index: 2;
  padding-block: clamp(2rem, 4vw, 3rem) clamp(3rem, 6vw, 4.75rem);
  max-width: 58ch;
}

/* Dedicated scrim behind the text block. This guarantees legible contrast
   independently of what the photograph happens to contain at this breakpoint,
   so the copy can never wash out over a bright region of the image. */
.act-hero__inner::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  left: 50%;
  right: -12%;
  transform: translateX(-50%);
  width: 100vw;
  background:
    radial-gradient(115% 88% at 22% 50%, rgba(14,16,22,0.90) 0%, rgba(14,16,22,0.74) 42%, rgba(14,16,22,0.30) 68%, rgba(14,16,22,0) 84%);
  pointer-events: none;
}
.act-hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 4.4vw, 3.5rem);
  letter-spacing: -0.026em;
  max-width: 20ch;
  margin-bottom: 0.45em;
}
.act-hero__lead { color: rgba(246,243,236,0.82); font-size: clamp(1rem, 1.3vw, 1.16rem); line-height: 1.62; }
.act-hero .breadcrumbs, .act-hero .breadcrumbs a { color: rgba(246,243,236,0.6); }
.act-hero .breadcrumbs a:hover { color: var(--white); }
.act-hero .activity-code-badge { background: rgba(246,243,236,0.14); color: var(--white); border: 1px solid rgba(246,243,236,0.3); backdrop-filter: blur(6px); }

/* Category indicator chips */
.act-hero__cats { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.9rem; }
.act-hero__cats span {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: rgba(246,243,236,0.86);
  border: 1px solid rgba(246,243,236,0.26);
  background: rgba(246,243,236,0.07);
  padding: 0.42em 0.85em;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.act-hero__cats span::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--cc, var(--cobalt-bright));
}

/* Animated software-flow / route line across the hero */
.act-hero__route {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, var(--accent), transparent 70%);
  transform-origin: left;
  animation: route-draw 1500ms var(--ease-out) 250ms both;
}
@keyframes route-draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* =======================================================================
   STAGE FLOW DIAGRAM (.stage-flow) - numbered horizontal sequence
   ======================================================================= */
.stage-flow {
  display: grid;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr));
  gap: 0.7rem;
  position: relative;
}
.stage-flow__item {
  position: relative;
  min-width: 0;
  padding: 1.15rem 1rem;
  border-radius: var(--radius-m);
  border: 1px solid rgba(14,16,22,0.12);
  background: var(--white);
  transition: transform var(--dur-mid) var(--ease-out), border-color var(--dur-mid);
}
.stage-flow__item:hover { transform: translateY(-3px); border-color: var(--sc, var(--cobalt)); }
.stage-flow__item::after {
  content: "";
  position: absolute;
  right: -0.7rem; top: 50%;
  width: 0.7rem; height: 1.5px;
  background: rgba(14,16,22,0.2);
}
.stage-flow__item:last-child::after { display: none; }

.stage-flow__n {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  color: var(--sc, var(--cobalt));
  display: block;
  margin-bottom: 0.55em;
}
.stage-flow__item h4 { font-size: 0.93rem; margin: 0 0 0.35em; letter-spacing: -0.012em; line-height: 1.25; }
.stage-flow__item p { font-size: 0.79rem; color: var(--graphite); margin: 0; line-height: 1.45; max-width: none; }

/* progressive node dot */
.stage-flow__dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--sc, var(--cobalt));
  background: var(--white);
  margin-bottom: 0.75rem;
  transition: background var(--dur-mid), box-shadow var(--dur-mid);
}
.stage-flow.is-active .stage-flow__dot {
  background: var(--sc, var(--cobalt));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--sc, var(--cobalt)) 16%, transparent);
}

.on-dark .stage-flow__item { background: rgba(246,243,236,0.05); border-color: rgba(246,243,236,0.13); }
.on-dark .stage-flow__item h4 { color: var(--white); }
.on-dark .stage-flow__item p { color: rgba(246,243,236,0.66); }
.on-dark .stage-flow__dot { background: var(--midnight); }
.on-dark .stage-flow__item::after { background: rgba(246,243,236,0.2); }

@media (max-width: 1080px) { .stage-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); } .stage-flow__item::after { display: none; } }
@media (max-width: 700px)  { .stage-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px)  { .stage-flow { grid-template-columns: minmax(0, 1fr); } }

/* =======================================================================
   CROSS-DEVICE STRUCTURE DIAGRAM (.xdev)
   ======================================================================= */
.xdev {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
}
.xdev__devices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}
.xdev__device {
  text-align: center;
  padding: 1.1rem 0.75rem;
  border-radius: var(--radius-m);
  border: 1px solid rgba(246,243,236,0.16);
  background: rgba(246,243,236,0.05);
}
.xdev__device svg { margin: 0 auto 0.6rem; display: block; }
.xdev__device span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--luminous);
}
.xdev__connector { display: block; width: 100%; height: 54px; }
.xdev__layers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.9rem; }
.xdev__layer {
  padding: 1.1rem 1rem;
  border-radius: var(--radius-m);
  border: 1px solid rgba(246,243,236,0.16);
  background: rgba(246,243,236,0.05);
  border-top: 3px solid var(--lc, var(--cobalt-bright));
  min-width: 0;
}
.xdev__layer h4 { color: var(--white); font-size: 0.92rem; margin: 0 0 0.35em; }
.xdev__layer p { font-size: 0.79rem; color: rgba(246,243,236,0.66); margin: 0; line-height: 1.45; max-width: none; }

@media (max-width: 900px) { .xdev__layers { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .xdev__layers { grid-template-columns: minmax(0, 1fr); }
  .xdev__devices { grid-template-columns: minmax(0, 1fr); }
  .xdev__connector { height: 28px; }
}

/* Animated path drawing for inline SVG diagrams */
.draw-path {
  stroke-dasharray: var(--len, 300);
  stroke-dashoffset: var(--len, 300);
  animation: draw 1600ms var(--ease-out) 200ms forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .draw-path { animation: none; stroke-dashoffset: 0; }
  .act-hero__route { animation: none; transform: scaleX(1); }
}

/* Explicit pointer affordance across the whole clickable card surface */
.svc-card,
.activity-panel { cursor: pointer; }
.svc-card__actions,
.svc-card__actions .btn { cursor: pointer; }
