/* ==========================================================================
   TechAbbot – technology expertise showcase
   Markup: partials/technologies.html (generated by tools/build-technologies.js)
   Behaviour: js/technologies.js

   Dark navy section. Category tabs on the left, the selected category's
   logos on the right. Each logo sits on a white tile so its own brand
   colours read correctly on the dark background.

     below 768px    tabs become one horizontally scrollable row above the logos
     768px and up   vertical tabs on the left, logos on the right

   Without JavaScript (<html> has no .js class) the tabs are not shown and
   all seven categories are listed one after another.
   ========================================================================== */

.tech {
  --tech-bg: #07172D;
  --tech-panel: #0D2238;
  --tech-active: #123C52;
  --tech-line: #28465D;
  --tech-muted: #C2CFDC;

  position: relative;
  padding-block: clamp(52px, 6.5vw, 96px);
  background: var(--tech-bg);
  color: #fff;
  isolation: isolate;
  overflow: hidden;
}

/* Ambient light and a network of dots behind the showcase. */
.tech::before,
.tech::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.tech::before {
  background:
    radial-gradient(36% 50% at 100% 0%, rgba(8, 113, 167, 0.36), transparent 70%),
    radial-gradient(32% 46% at 0% 100%, rgba(38, 150, 94, 0.26), transparent 70%);
}

.tech::after {
  background-image: radial-gradient(circle, rgba(194, 207, 220, 0.16) 1.2px, transparent 1.7px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(70% 70% at 70% 60%, #000, transparent 75%);
  mask-image: radial-gradient(70% 70% at 70% 60%, #000, transparent 75%);
}

.tech :focus-visible {
  outline-color: #fff;
  outline-offset: 2px;
}

/* Heading block ----------------------------------------------------------- */

.tech__head {
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}

.tech__label { color: var(--c-blue-bright); }

.tech__label::before,
.tech__label::after { background: var(--gradient-logo-bright); }

.tech__title {
  margin: 14px 0 0;
  font-size: clamp(1.75rem, 1.25rem + 2.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.tech__accent { color: var(--c-green-bright); }

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .tech__accent {
    background: var(--gradient-logo-bright);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    -webkit-text-fill-color: transparent;
  }
}

.tech__intro {
  max-width: 44em;
  margin: 16px auto 0;
  color: var(--tech-muted);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
}

/* Explorer ------------------------------------------------------------------ */

.tech__explorer {
  display: grid;
  gap: 18px;
  margin-top: clamp(30px, 4vw, 52px);
}

.tech__icon {
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Tabs: a scrollable row on small screens. */
html:not(.js) .tech__nav { display: none; }

.tech__nav {
  display: flex;
  gap: 8px;
  margin-inline: calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: var(--tech-line) transparent;
}

.tech__tab {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 8px 16px;
  border: 1px solid var(--tech-line);
  border-radius: 999px;
  background: rgba(13, 34, 56, 0.7);
  color: var(--tech-muted);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  scroll-snap-align: start;
  transition: color var(--ease), background-color var(--ease), border-color var(--ease);
}

.tech__tab-number {
  color: #6F879B;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  transition: color var(--ease);
}

.tech__tab:hover {
  border-color: var(--c-blue-bright);
  color: #fff;
}

.tech__tab.is-active {
  border-color: transparent;
  background: linear-gradient(90deg, #1F7D4E, #0871A7);
  color: #fff;
}

.tech__tab.is-active .tech__tab-number { color: #fff; }

/* Panels */

.tech__panels { min-width: 0; }

.tech-panel {
  padding: clamp(18px, 2.6vw, 34px);
  border: 1px solid var(--tech-line);
  border-radius: 20px;
  background: rgba(13, 34, 56, 0.72);
}

.js .tech-panel:not(.is-active) { display: none; }

html:not(.js) .tech-panel + .tech-panel { margin-top: 18px; }

.tech-panel__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 14px;
  padding-bottom: clamp(14px, 2vw, 20px);
  border-bottom: 1px solid var(--tech-line);
}

.tech-panel__number {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--c-green-bright);
  font-variant-numeric: tabular-nums;
}

.tech-panel__title {
  margin: 0;
  font-size: clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.tech-panel__count {
  margin: 0 0 0 auto;
  color: var(--tech-muted);
  font-size: 0.875rem;
}

.tech-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: clamp(14px, 2vw, 22px) clamp(8px, 1.4vw, 16px);
  margin: clamp(18px, 2.4vw, 28px) 0 0;
  padding: 0;
  list-style: none;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  text-align: center;
}

/* Tiles rise in one after another when a category is shown. */
.js .tech-panel.is-active .tech-item {
  animation: tech-in 360ms ease both;
  animation-delay: calc(var(--i) * 45ms);
}

@keyframes tech-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

.tech-item__logo {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 76px;
  height: 76px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 16px 26px -16px rgba(0, 0, 0, 0.9);
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.tech-item__logo img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* No authentic logo available: the name set as plain text, not a drawn mark. */
.tech-item__logo--text {
  padding: 6px;
  border: 1px dashed #6F879B;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

@media (hover: hover) {
  .tech-item:hover .tech-item__logo {
    box-shadow: 0 0 0 2px var(--c-green-bright), 0 20px 30px -14px rgba(79, 208, 143, 0.55);
    transform: translateY(-4px);
  }
}

.tech-item__name {
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Vertical tabs beside the showcase ------------------------------------------- */

@media (min-width: 768px) {
  .js .tech__explorer {
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(18px, 2.4vw, 32px);
  }

  .tech__nav {
    flex-direction: column;
    gap: 0;
    margin-inline: 0;
    padding: 6px;
    border: 1px solid var(--tech-line);
    border-radius: 20px;
    background: rgba(13, 34, 56, 0.72);
    overflow: visible;
  }

  .tech__tab {
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 10px 14px;
    border: 0;
    border-radius: 14px;
    background: none;
    font-size: 1rem;
    white-space: normal;
    text-align: left;
  }

  .tech__tab + .tech__tab { margin-top: 2px; }

  .tech__tab:hover { background: rgba(255, 255, 255, 0.06); }

  .tech__tab.is-active { background: linear-gradient(90deg, #1F7D4E, #0871A7); }

  /* Pointer on the active tab, towards the showcase. */
  .tech__tab::after {
    content: "\2192";
    margin-left: auto;
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity var(--ease), transform var(--ease);
  }

  .tech__tab.is-active::after {
    opacity: 1;
    transform: none;
  }

  .js .tech-panel { min-height: 100%; }

  .tech-panel__grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }

  .tech-item__logo {
    width: 84px;
    height: 84px;
  }

  .tech-item__logo img {
    width: 44px;
    height: 44px;
  }
}

/* Heading on a single line where there is room for it. */
@media (min-width: 960px) {
  .tech__head { max-width: none; }

  .tech__title { white-space: nowrap; }
}

/* Optional button under the explorer. */
.tech__cta {
  margin: clamp(28px, 3.4vw, 44px) 0 0;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .js .tech-panel.is-active .tech-item { animation: none; }

  .tech__tab,
  .tech__tab::after,
  .tech-item__logo { transition: none; }

  .tech-item:hover .tech-item__logo { transform: none; }
}
