/* ==========================================================================
   TECHMATIC SYSTEMS - Digital Engineering Services ("Blueprint")
   --------------------------------------------------------------------------
   INTEGRATION CONTRACT
     Loaded only by template-digital-engineering.php. Every rule is scoped
     under .tmde - nothing targets html, body, :root or a bare element - so
     nothing here can reach the theme's header, footer or other pages. The
     layout uses its own CSS grid, not Bootstrap classes, so it renders the
     same whatever Bootstrap version the theme ships.

   ART DIRECTION - engineering drawings
     Colour   Cyanotype blueprint blue with white line-work. The brand red is
              the live "signal": pulses, the selected service, actions.
     Type     Archivo pushed wide for headings (the stance of a drawing
              title), IBM Plex Sans for text.
     Marks    Engineering vernacular instead of decoration: drawing grids,
              dimension lines under titles, a title block for "Why Choose",
              component tags for the technologies.
     Motion   One orchestrated moment: the hero schematic draws itself and
              signals start to flow. Everything else moves only in answer to
              the visitor (selecting a service, opening an answer).

   THE THEME'S FIXED HEADER
     The site header is position:fixed and page content starts underneath
     it. digital-main.js measures how much of the block the header covers and
     writes it to --de-header-h; the hero's top padding, the sticky panel and
     in-page scrolling all add that clearance. 120px is the fallback before
     the script runs.
   ========================================================================== */

/* The fonts load from here as well as from the template, so the design
   keeps its type even when only the content block is pasted into a page.
   (@import must stay above every rule.) */
@import url("https://fonts.googleapis.com/css2?family=Archivo:wdth,wght@62..125,400..800&family=IBM+Plex+Sans:wght@400;500;600&display=swap");

.tmde {
  --de-header-h: 120px;   /* measured and replaced by digital-main.js */
  --de-bp:      #133A6E;   /* cyanotype */
  --de-bp-deep: #0C2A55;
  --de-bp-line: rgba(255, 255, 255, .22);
  --de-bp-grid: rgba(255, 255, 255, .07);
  --de-paper:   #F2F5F9;
  --de-ink:     #0D1B2E;
  --de-ink-2:   #42526A;
  --de-rule:    #C9D3E0;
  --de-signal:  #E0303F;   /* the brand red, lifted to read on blue */
  --de-signal-dk: #C11F2D;
  --de-ease:    cubic-bezier(.22, 1, .36, 1);
  --de-disp:    "Archivo", "Helvetica Neue", Arial, sans-serif;
  --de-text:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  font-family: var(--de-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  color: var(--de-ink);
  background: var(--de-paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Scoped reset - explicit values so theme rules cannot shift us. */
.tmde *, .tmde *::before, .tmde *::after { box-sizing: border-box; }
.tmde h1, .tmde h2, .tmde h3 { font-family: var(--de-disp); color: inherit; margin: 0; }
/* Text elements take the page's own font rather than the theme's or
   Elementor's typography (which targets p, li and a directly, and would
   otherwise beat plain inheritance). Classes that set a font still win. */
.tmde p, .tmde li, .tmde a, .tmde span, .tmde button { font-family: inherit; }
.tmde p { margin: 0; font-size: inherit; line-height: inherit; color: inherit; }
.tmde ul { margin: 0; padding: 0; list-style: none; }
.tmde li { margin: 0; }
.tmde a { color: inherit; }
.tmde svg { display: block; max-width: 100%; }
.tmde :focus-visible { outline: 2px solid var(--de-signal); outline-offset: 3px; }
.tmde [id] { scroll-margin-top: calc(var(--de-header-h) + 20px); }

.tmde .de-wrap { width: min(1200px, 100% - 48px); margin-inline: auto; }
.tmde .de-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Display type: Archivo wide. */
.tmde .de-disp {
  font-family: var(--de-disp); font-variation-settings: "wdth" 118; font-weight: 750;
  letter-spacing: -.02em; line-height: 1.02;
}
.tmde .de-h2 { font-size: clamp(30px, 3.6vw, 48px); }
.tmde .de-h3 {
  font-family: var(--de-disp); font-variation-settings: "wdth" 108; font-weight: 700;
  font-size: 21px; line-height: 1.25; margin-bottom: 10px;
}

/* Dimension line under section titles: a hairline with end ticks. */
.tmde .de-dim { position: relative; display: block; width: 120px; height: 12px; margin-top: 22px; color: var(--de-signal); }
.tmde .de-dim::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: currentColor; }
.tmde .de-dim::after  { content: ""; position: absolute; inset: 0; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }

/* Drawing-sheet grid, reused by every blueprint surface. */
.tmde .de-grid-bg {
  background-color: var(--de-bp);
  background-image:
    linear-gradient(var(--de-bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--de-bp-grid) 1px, transparent 1px);
  background-size: 24px 24px;
}


/* ==========================================================================
   BUTTONS
   ========================================================================== */
.tmde .de-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px 26px; border: 1.5px solid transparent; border-radius: 4px;
  font-family: var(--de-text); font-size: 15px; font-weight: 600; line-height: 1;
  text-decoration: none; cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s, transform .3s var(--de-ease);
}
.tmde .de-btn:hover { transform: translateY(-2px); }
.tmde .de-btn svg { width: 16px; height: 16px; flex: none; }
.tmde .de-btn--signal { background: var(--de-signal); color: #fff; }
.tmde .de-btn--signal:hover { background: var(--de-signal-dk); color: #fff; }
.tmde .de-btn--line { color: #fff; border-color: rgba(255, 255, 255, .55); }
.tmde .de-btn--line:hover { color: #fff; background: rgba(255, 255, 255, .1); border-color: #fff; }


/* ==========================================================================
   HERO
   ========================================================================== */
.tmde .de-hero {
  position: relative; overflow: hidden; color: #fff;
  /* header clearance (measured) + the gap above the heading */
  padding: calc(var(--de-header-h) + 72px) 0 88px;
  background:
    linear-gradient(var(--de-bp-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--de-bp-grid) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(255, 255, 255, .12) 1px, transparent 1px) 0 0 / 120px 120px,
    radial-gradient(120% 90% at 80% 0%, var(--de-bp) 0%, var(--de-bp-deep) 70%);
}
.tmde .de-hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 48px; align-items: center; }
.tmde .de-hero h1 { font-size: clamp(42px, 5.3vw, 80px); font-variation-settings: "wdth" 112; color: #fff; }
.tmde .de-hero h1 span { display: block; }
.tmde .de-hero-lede { color: rgba(255, 255, 255, .82); max-width: 34em; margin: 28px 0 36px; font-size: 18px; }
.tmde .de-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

/* The schematic. Two drawings of the same system: wide for desktop and
   tablet, tall for phones so its labels stay readable. */
.tmde .de-schem { width: 100%; height: auto; overflow: visible; }
.tmde .de-schem--tall { display: none; max-width: 420px; margin-inline: auto; }
.tmde .de-schem .de-trace { fill: none; stroke: var(--de-bp-line); stroke-width: 1.5; }
.tmde .de-schem .de-sheet { fill: none; stroke: var(--de-bp-line); stroke-width: 1.5; stroke-dasharray: 4 6; }
.tmde .de-schem .de-joint { fill: #fff; }
.tmde .de-schem .de-node { cursor: pointer; }
.tmde .de-schem .de-node:focus { outline: none; }
.tmde .de-schem .de-node rect { fill: rgba(12, 42, 85, .78); stroke: rgba(255, 255, 255, .75); stroke-width: 1.5; transition: fill .3s, stroke .3s; }
.tmde .de-schem .de-node text { fill: #fff; font-family: var(--de-text); font-size: 13px; font-weight: 600; }
.tmde .de-schem .de-node .de-ico { fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tmde .de-schem .de-node:hover rect,
.tmde .de-schem .de-node:focus-visible rect,
.tmde .de-schem .de-node.is-on rect { fill: var(--de-signal); stroke: var(--de-signal); }
.tmde .de-schem .de-pulse { fill: var(--de-signal); filter: drop-shadow(0 0 6px rgba(224, 48, 63, .9)); offset-rotate: 0deg; animation: deRide var(--t, 2s) linear infinite var(--d, 0s); }
@keyframes deRide { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.tmde .de-schem-note { margin-top: 14px; font-size: 13px; color: rgba(255, 255, 255, .62); }

/* Load sequence - gated on html.de-js so the drawing is simply there if
   the script never runs. */
.de-js .tmde .de-schem .de-draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.de-js .tmde .de-schem.is-drawn .de-draw { stroke-dashoffset: 0; transition: stroke-dashoffset 1.4s var(--de-ease) var(--d, 0s); }
.de-js .tmde .de-schem .de-node { opacity: 0; }
.de-js .tmde .de-schem.is-drawn .de-node { opacity: 1; transition: opacity .6s ease var(--d, 0s); }
.de-js .tmde .de-schem .de-pulse { opacity: 0; }
.de-js .tmde .de-schem.is-live .de-pulse { opacity: 1; transition: opacity .4s; }


/* ==========================================================================
   SECTIONS
   ========================================================================== */
.tmde .de-sec { position: relative; padding: 112px 0; }
.tmde .de-sec--white { background: #fff; }
.tmde .de-sec--flush { padding-top: 0; }
.tmde .de-head { max-width: 760px; margin-bottom: 56px; }


/* ==========================================================================
   SERVICES - interactive spec sheet
   The list is the content; on wide screens the selected row's text is also
   shown large in the blueprint panel beside it.
   ========================================================================== */
/* Default (no script, or narrow screens): a plain list with every
   description showing. The two-column spec sheet switches on only when the
   script has run on a wide screen - see the media query below. */
.tmde .de-spec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; align-items: start; }
.tmde .de-spec-panel {
  display: none; position: sticky; top: calc(var(--de-header-h) + 24px); min-height: 420px;
  color: #fff; border-radius: 6px; padding: 40px 38px 44px; overflow: hidden;
}
.tmde .de-spec-panel .de-big-ico { width: 88px; height: 88px; margin-bottom: 30px; fill: none; stroke: #fff; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.tmde .de-spec-panel .de-big-ico * { stroke-dasharray: 240; stroke-dashoffset: 0; }
.tmde .de-spec-panel.is-drawing .de-big-ico * { animation: deDrawIco 1s var(--de-ease); }
@keyframes deDrawIco { from { stroke-dashoffset: 240; } to { stroke-dashoffset: 0; } }
.tmde .de-spec-panel .de-panel-title {
  font-variation-settings: "wdth" 115; font-weight: 750; letter-spacing: -.015em;
  font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; margin-bottom: 18px; color: #fff;
}
.tmde .de-spec-panel .de-panel-text { color: rgba(255, 255, 255, .84); }
.tmde .de-spec-panel .de-fade { transition: opacity .3s, transform .45s var(--de-ease); }
.tmde .de-spec-panel.is-swapping .de-fade { opacity: 0; transform: translateY(8px); }
.tmde .de-spec-panel .de-corner {
  position: absolute; right: 18px; bottom: 16px; width: 64px; height: 64px;
  border-right: 1.5px solid rgba(255, 255, 255, .35); border-bottom: 1.5px solid rgba(255, 255, 255, .35);
}

.tmde .de-spec-list { border-top: 1.5px solid var(--de-ink); }
.tmde .de-spec-row { border-bottom: 1px solid var(--de-rule); }
/* The heading only gives each service its place in the outline; the
   button inside it sets the look. */
.tmde .de-spec-h { font-size: inherit; font-weight: inherit; line-height: inherit; letter-spacing: normal; }
.tmde .de-spec-btn {
  width: 100%; display: flex; align-items: center; gap: 18px; padding: 24px 6px; margin: 0;
  background: none; border: 0; border-radius: 0; cursor: pointer; text-align: left; color: var(--de-ink);
  font-family: var(--de-disp); font-variation-settings: "wdth" 108; font-weight: 650;
  font-size: clamp(19px, 1.8vw, 24px); line-height: 1.25;
  transition: color .25s, padding-left .4s var(--de-ease);
}
.tmde .de-spec-btn .de-ico { width: 30px; height: 30px; flex: none; fill: none; stroke: var(--de-ink-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: stroke .25s; }
.tmde .de-spec-btn .de-tick { margin-left: auto; flex: none; width: 26px; height: 1.5px; background: var(--de-ink); position: relative; transition: width .4s var(--de-ease), background-color .25s; }
.tmde .de-spec-btn .de-tick::after {
  content: ""; position: absolute; right: -1px; top: -4px; width: 8px; height: 8px;
  border-top: 1.5px solid var(--de-ink); border-right: 1.5px solid var(--de-ink); transform: rotate(45deg);
  transition: border-color .25s;
}
.tmde .de-spec-btn:hover,
.tmde .de-spec-row.is-on .de-spec-btn { color: var(--de-signal); padding-left: 16px; }
.tmde .de-spec-btn:hover .de-ico,
.tmde .de-spec-row.is-on .de-spec-btn .de-ico { stroke: var(--de-signal); }
.tmde .de-spec-row.is-on .de-spec-btn .de-tick { width: 48px; background: var(--de-signal); }
.tmde .de-spec-row.is-on .de-spec-btn .de-tick::after { border-color: var(--de-signal); }
.tmde .de-spec-text { display: block; padding: 0 6px 24px 54px; color: var(--de-ink-2); }

@media (min-width: 992px) {
  .de-js .tmde .de-spec { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
  .de-js .tmde .de-spec-panel { display: block; }
  /* the text lives in the panel; rows show titles only */
  .de-js .tmde .de-spec-text { display: none; }
}


/* ==========================================================================
   WHY CHOOSE - a drawing's title block
   ========================================================================== */
.tmde .de-titleblock { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1.5px solid var(--de-ink); background: #fff; }
.tmde .de-tb-cell {
  grid-column: span 2; position: relative; padding: 30px 28px 34px;
  border-right: 1px solid var(--de-ink); border-bottom: 1px solid var(--de-ink);
  transition: background-color .3s;
}
.tmde .de-tb-cell:nth-child(3) { border-right: 0; }
.tmde .de-tb-cell:nth-child(n+4) { grid-column: span 3; border-bottom: 0; }
.tmde .de-tb-cell:nth-child(5) { border-right: 0; }
.tmde .de-tb-cell p { color: var(--de-ink-2); font-size: 16px; }
.tmde .de-tb-cell::before { content: ""; position: absolute; left: 0; top: 0; width: 0; height: 3px; background: var(--de-signal); transition: width .5s var(--de-ease); }
.tmde .de-tb-cell:hover { background: var(--de-paper); }
.tmde .de-tb-cell:hover::before { width: 100%; }


/* ==========================================================================
   EXPERTISE - component tags (the technologies named in FAQ 4)
   ========================================================================== */
.tmde .de-parts { display: flex; flex-wrap: wrap; gap: 12px; }
.tmde .de-part {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 22px 14px 16px; border: 1.5px solid var(--de-ink); border-radius: 4px; background: #fff;
  font-family: var(--de-disp); font-variation-settings: "wdth" 108; font-weight: 650; font-size: 17px; line-height: 1.2;
  transition: background-color .25s, color .25s;
}
.tmde .de-part::before { content: ""; width: 10px; height: 10px; border: 1.5px solid currentColor; border-radius: 50%; transition: background-color .25s, border-color .25s; }
.tmde .de-part:hover { background: var(--de-ink); color: #fff; }
.tmde .de-part:hover::before { background: var(--de-signal); border-color: var(--de-signal); }


/* ==========================================================================
   FAQ - accordion; with no script every answer simply shows
   ========================================================================== */
.tmde .de-faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 56px; }
.tmde .de-faq { border-top: 1.5px solid var(--de-ink); }
.tmde .de-faq-item { border-bottom: 1px solid var(--de-rule); }
.tmde .de-faq-q {
  width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 24px;
  padding: 24px 4px; margin: 0; background: none; border: 0; border-radius: 0; cursor: pointer; text-align: left;
  font-family: var(--de-text); font-size: 18px; font-weight: 600; line-height: 1.4; color: var(--de-ink);
  transition: color .25s;
}
.tmde .de-faq-q:hover { color: var(--de-signal); }
.tmde .de-faq-x { flex: none; position: relative; width: 18px; height: 18px; }
.tmde .de-faq-x::before, .tmde .de-faq-x::after {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; margin-top: -.75px;
  background: currentColor; transition: transform .4s var(--de-ease);
}
.tmde .de-faq-x::after { transform: rotate(90deg); }
.tmde .de-faq-item.is-open .de-faq-x::after { transform: rotate(0); }
.tmde .de-faq-a { display: grid; grid-template-rows: 1fr; }
.de-js .tmde .de-faq-a { grid-template-rows: 0fr; transition: grid-template-rows .45s var(--de-ease); }
.de-js .tmde .de-faq-item.is-open .de-faq-a { grid-template-rows: 1fr; }
.tmde .de-faq-a > div { overflow: hidden; }
.tmde .de-faq-a p { padding: 0 4px 24px; color: var(--de-ink-2); max-width: 62ch; }


/* ==========================================================================
   CTA - blueprint card with a signal running along its base
   ========================================================================== */
.tmde .de-cta { position: relative; overflow: hidden; color: #fff; border-radius: 6px; padding: 72px 64px 80px; }
.tmde .de-cta-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 40px; align-items: end; }
.tmde .de-cta .de-h2 { color: #fff; }
.tmde .de-cta p { color: rgba(255, 255, 255, .84); margin-top: 22px; max-width: 40em; }
.tmde .de-cta-actions { justify-self: end; }
.tmde .de-cta-trace { position: absolute; left: 0; right: 0; bottom: 26px; height: 2px; background: rgba(255, 255, 255, .14); }
.tmde .de-cta-trace i {
  position: absolute; top: -3px; left: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--de-signal); box-shadow: 0 0 12px var(--de-signal);
  animation: deRun 5s linear infinite;
}
@keyframes deRun { from { left: -2%; } to { left: 102%; } }


/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 991.98px) {
  .tmde .de-hero-grid,
  .tmde .de-faq-grid,
  .tmde .de-cta-grid { grid-template-columns: minmax(0, 1fr); }
  .tmde .de-hero-grid { gap: 56px; }
  /* No panel here; with the script, each row opens its own text in place. */
  .de-js .tmde .de-spec-text { max-height: 0; overflow: hidden; padding-bottom: 0; transition: max-height .45s var(--de-ease), padding-bottom .45s var(--de-ease); }
  .de-js .tmde .de-spec-row.is-on .de-spec-text { max-height: 420px; padding-bottom: 24px; }
  .tmde .de-titleblock { grid-template-columns: minmax(0, 1fr); }
  .tmde .de-tb-cell,
  .tmde .de-tb-cell:nth-child(n+4) { grid-column: auto; border-right: 0; border-bottom: 1px solid var(--de-ink); }
  .tmde .de-tb-cell:last-child { border-bottom: 0; }
  .tmde .de-cta-actions { justify-self: start; }
}
@media (max-width: 575.98px) {
  .tmde { font-size: 16px; }
  .tmde .de-sec { padding: 76px 0; }
  .tmde .de-sec--flush { padding-top: 0; }
  .tmde .de-hero { padding: calc(var(--de-header-h) + 44px) 0 64px; }
  .tmde .de-hero-lede { font-size: 17px; }
  .tmde .de-hero-cta .de-btn { width: 100%; }
  .tmde .de-schem--wide { display: none; }
  .tmde .de-schem--tall { display: block; }
  .tmde .de-spec-btn { font-size: 18px; gap: 14px; }
  .tmde .de-spec-text { padding-left: 50px; }
  .tmde .de-faq-q { font-size: 17px; }
  .tmde .de-cta { padding: 48px 26px 64px; }
  .tmde .de-cta .de-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .tmde *, .tmde *::before, .tmde *::after { transition: none !important; animation: none !important; }
  .de-js .tmde .de-schem .de-draw { stroke-dashoffset: 0; }
  .de-js .tmde .de-schem .de-node,
  .de-js .tmde .de-schem .de-pulse { opacity: 1; }
  .tmde .de-schem .de-pulse { display: none; }
}
