/*
 * experience-tech-tree.css
 * --------------------------------------------------------------------------
 * Dedicated styling for the interactive Experience Tech Tree page.
 *
 * Responsibilities:
 * - Creates the desktop branching tree layout.
 * - Converts the layout into a vertical tree on smaller screens.
 * - Styles selectable nodes, connection paths and detail panels.
 * - Supports reduced motion and keyboard focus visibility.
 *
 * Related files:
 * - experience.html
 * - js/experience-tech-tree.js
 * --------------------------------------------------------------------------
 */

:root {
  --tree-bg: #080c14;
  --tree-panel: rgba(15, 22, 37, 0.88);
  --tree-panel-strong: rgba(18, 27, 47, 0.96);
  --tree-border: rgba(157, 174, 214, 0.16);
  --tree-text: #f4f7fb;
  --tree-muted: #a9b5c8;
  --tree-purple: #8878ff;
  --tree-blue: #56a8ff;
  --tree-teal: #31d8bc;
  --tree-gold: #f4c86a;
  --tree-pink: #e57fcb;
}

html {
  scroll-behavior: smooth;
}

.tech-tree-page {
  margin: 0;
  background: var(--tree-bg);
  color: var(--tree-text);
}

.tree-shell {
  width: min(1240px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.tree-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 78vh;
  display: grid;
  align-items: center;
  padding: 9rem 0 6rem;
  background:
    radial-gradient(circle at 22% 28%, rgba(94, 95, 255, 0.20), transparent 30rem),
    radial-gradient(circle at 80% 66%, rgba(49, 216, 188, 0.12), transparent 28rem),
    linear-gradient(180deg, #080c14 0%, #0b1020 100%);
}

.tree-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 14%;
  right: 7%;
  width: min(34vw, 31rem);
  aspect-ratio: 1;

  border: 1px solid rgba(136, 120, 255, 0.28);
  border-radius: 50%;

  background:
    linear-gradient(rgba(8, 12, 20, 0.08), rgba(8, 12, 20, 0.18)),
    url("../images/Mountainlaptop.jpg") center / cover no-repeat;

  box-shadow:
    0 0 0 3rem rgba(136, 120, 255, 0.035),
    0 0 0 7rem rgba(49, 216, 188, 0.022),
    0 24px 70px rgba(0, 0, 0, 0.34);
}

.tree-hero__grid {
  position: absolute;
  z-index: -2;
  inset: 0;
  opacity: 0.34;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.tree-eyebrow {
  margin: 0 0 0.8rem;
  color: #9ca8ff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.tree-hero h1 {
  max-width: 830px;
  margin: 0;
  font-size: clamp(3.4rem, 9vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.tree-hero__intro {
  max-width: 700px;
  margin: 1.75rem 0 0;
  color: var(--tree-muted);
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.75;
}

.tree-hero__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.4rem;
  margin-top: 2rem;
  color: #c1cada;
  font-size: 0.84rem;
}

.tree-hero__legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legend-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  box-shadow: 0 0 14px currentColor;
}

.legend-dot--advanced {
  background: var(--tree-purple);
  color: var(--tree-purple);
}

.legend-dot--active {
  background: var(--tree-teal);
  color: var(--tree-teal);
}

.legend-dot--research {
  background: var(--tree-blue);
  color: var(--tree-blue);
}

.legend-dot--foundation {
  background: var(--tree-gold);
  color: var(--tree-gold);
}

.tree-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.3rem;
}

.tree-button {
  display: inline-flex;
  min-height: 3.15rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}

.tree-button:hover {
  transform: translateY(-2px);
}

.tree-button--primary {
  background: linear-gradient(135deg, #7768ff, #5c9cff);
  color: #ffffff;
  box-shadow: 0 14px 38px rgba(93, 106, 255, 0.26);
}

.tree-button--ghost {
  border-color: rgba(172, 187, 222, 0.20);
  background: rgba(255, 255, 255, 0.035);
  color: #e8edf7;
}

.skill-tree-section {
  padding: clamp(5rem, 9vw, 8rem) 0;
  background:
    radial-gradient(circle at 50% 15%, rgba(63, 107, 255, 0.08), transparent 36rem),
    linear-gradient(180deg, #0b1020, #090d17);
}

.skill-tree-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 3rem;
}

.skill-tree-header h2,
.experience-story h2,
.tree-cta h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.055em;
}

.skill-tree-header > p {
  margin: 0;
  color: var(--tree-muted);
  line-height: 1.7;
}

.skill-tree {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.78fr);
  grid-template-rows: auto auto;
  gap: 6rem 2.75rem;
  min-height: 1540px;
  padding: 2rem 0 1.25rem;
}

.skill-tree__connections {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.skill-tree__connections path {
  fill: none;
  stroke: rgba(135, 150, 255, 0.34);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.72;
  transition:
    stroke 180ms ease,
    stroke-width 180ms ease,
    opacity 180ms ease,
    filter 180ms ease;
}

.skill-tree__connections path.is-cross-link {
  stroke: rgba(244, 200, 106, 0.42);
  stroke-dasharray: 7 8;
}

.skill-tree__connections path.is-muted {
  opacity: 0.12;
  filter: none;
}

.skill-tree__connections path.is-active {
  stroke: rgba(70, 216, 190, 0.96) !important;
  stroke-width: 3.4;
  stroke-dasharray: none;
  opacity: 1;
  filter: drop-shadow(0 0 9px rgba(49, 216, 188, 0.64));
}


.tree-node {
  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  min-height: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  align-self: start;
  padding: 0.78rem 0.85rem;
  border: 1px solid var(--tree-border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(21, 29, 50, 0.95), rgba(12, 18, 31, 0.96));
  color: var(--tree-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  appearance: none;
  -webkit-appearance: none;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.tree-node:hover {
  transform: translateY(-4px);
  border-color: rgba(139, 150, 255, 0.42);
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.28);
}

.tree-node:focus-visible {
  outline: 3px solid rgba(80, 170, 255, 0.8);
  outline-offset: 4px;
}

.tree-node.is-selected {
  border-color: rgba(49, 216, 188, 0.72);
  background:
    radial-gradient(circle at 88% 12%, rgba(49, 216, 188, 0.18), transparent 11rem),
    linear-gradient(145deg, rgba(25, 39, 58, 0.98), rgba(12, 22, 34, 0.98));
  box-shadow:
    0 0 0 1px rgba(49, 216, 188, 0.12),
    0 24px 60px rgba(0, 0, 0, 0.3),
    0 0 24px rgba(49, 216, 188, 0.10);
}

.tree-node.is-connected {
  border-color: rgba(86, 168, 255, 0.58);
  box-shadow:
    0 0 0 1px rgba(86, 168, 255, 0.10),
    0 18px 42px rgba(0, 0, 0, 0.22),
    0 0 20px rgba(86, 168, 255, 0.10);
}

.tree-node.is-dimmed {
  opacity: 0.48;
  filter: saturate(0.72);
}

.tree-node.is-selected,
.tree-node.is-connected {
  opacity: 1;
  filter: none;
}

.tree-node strong {
  margin-top: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.2;
}

.tree-node small {
  margin-top: 0.35rem;
  color: #94a1b7;
  font-size: 0.78rem;
  line-height: 1.45;
}

.tree-node__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  margin-bottom: 0.5rem;
  border: 1px solid rgba(137, 151, 255, 0.25);
  border-radius: 10px;
  background: rgba(120, 104, 255, 0.08);
  color: #aeb7ff;
  font-size: 0.92rem;
  font-weight: 900;
}

.tree-node__status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 1.45rem;
  padding: 0.24rem 0.5rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.tree-node__status--advanced {
  background: rgba(136, 120, 255, 0.14);
  color: #b8afff;
}

.tree-node__status--active {
  background: rgba(49, 216, 188, 0.12);
  color: #7be9d5;
}

.tree-node__status--research {
  background: rgba(86, 168, 255, 0.13);
  color: #8dc6ff;
}

.tree-node__status--foundation {
  background: rgba(244, 200, 106, 0.12);
  color: #f5d58c;
}

.tree-node--root {
  grid-column: 1 / -1;
  grid-row: 1;
  width: min(230px, 100%);
  justify-self: center;
  align-self: start;
  min-height: 0;
  padding: 0.85rem 1rem;
  align-items: center;
  text-align: center;
  border-color: rgba(136, 120, 255, 0.46);
}

.tree-node--root strong { font-size: 1.45rem; }

.tree-branch {
  position: relative;
  z-index: auto;
  grid-row: 2;
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tree-branch--software { grid-column: 1; }
.tree-branch--people { grid-column: 2; }

 .tree-node--branch { min-height: 0; }
.tree-node--software {
  width: min(500px, 76%);
  align-self: center;
  min-height: 0;
  padding: 0.82rem 1rem;
}

.tree-node--software .tree-node__icon {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  margin: 0;
}

.tree-node--subbranch { min-height: 0; }

.tree-platforms {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 3.25rem;
  align-items: start;
}

.tree-specialisms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  margin-top: 5.25rem;
  align-items: start;
}

.tree-specialism,
.tree-people-group { min-width: 0; }

.tree-people-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.05rem;
  margin-top: 5rem;
  align-items: start;
}

.tree-children {
  display: grid;
  gap: 0.9rem;
  margin-top: 3.75rem;
  padding-top: 0.75rem;
}

.tree-children--leadership {
  grid-template-columns: 1fr;
  margin-top: 0;
  padding-top: 0;
}

.tree-node--child {
  min-height: 0;
  padding: 0.7rem 0.78rem;
  border-radius: 15px;
}


.tree-node__platform-icon {
  display: grid;
  width: 1.85rem;
  height: 1.85rem;
  place-items: center;
  margin-bottom: 0.28rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0.72rem;
  background: rgba(255, 255, 255, 0.07);
  color: #f5f7ff;
  font-size: 1rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tree-node--platform {
  min-height: 0;
}

.tree-node--software {
  border-color: rgba(136, 120, 255, 0.38);
  background:
    radial-gradient(circle at 88% 10%, rgba(136, 120, 255, 0.18), transparent 9rem),
    linear-gradient(145deg, rgba(31, 30, 66, 0.98), rgba(15, 19, 38, 0.98));
}

.tree-node--web {
  border-color: rgba(86, 168, 255, 0.30);
  background: linear-gradient(145deg, rgba(20, 45, 75, 0.96), rgba(12, 24, 42, 0.98));
}

.tree-node--mobile {
  border-color: rgba(49, 216, 188, 0.30);
  background: linear-gradient(145deg, rgba(15, 57, 59, 0.96), rgba(10, 30, 35, 0.98));
}

.tree-node--desktop {
  border-color: rgba(168, 137, 255, 0.30);
  background: linear-gradient(145deg, rgba(43, 35, 73, 0.96), rgba(22, 20, 42, 0.98));
}

.tree-node--games {
  border-color: rgba(229, 127, 203, 0.31);
  background: linear-gradient(145deg, rgba(69, 30, 62, 0.96), rgba(36, 17, 36, 0.98));
}

.tree-node--data {
  border-color: rgba(86, 168, 255, 0.38);
  background:
    radial-gradient(circle at 90% 10%, rgba(86, 168, 255, 0.16), transparent 8rem),
    linear-gradient(145deg, rgba(22, 43, 71, 0.98), rgba(12, 24, 43, 0.98));
}

.tree-node--geo {
  border-color: rgba(49, 216, 188, 0.38);
  background:
    radial-gradient(circle at 90% 10%, rgba(49, 216, 188, 0.15), transparent 8rem),
    linear-gradient(145deg, rgba(16, 55, 57, 0.98), rgba(9, 29, 34, 0.98));
}

.tree-node--utilities {
  border-color: rgba(244, 200, 106, 0.40);
  background:
    radial-gradient(circle at 90% 10%, rgba(244, 200, 106, 0.15), transparent 8rem),
    linear-gradient(145deg, rgba(62, 48, 25, 0.98), rgba(34, 27, 16, 0.98));
}

.tree-node--people {
  border-color: rgba(229, 127, 203, 0.34);
  background:
    radial-gradient(circle at 90% 10%, rgba(229, 127, 203, 0.15), transparent 9rem),
    linear-gradient(145deg, rgba(60, 29, 57, 0.98), rgba(31, 18, 36, 0.98));
}

.tree-node--child strong { font-size: 0.9rem; }
.tree-node--child small { font-size: 0.72rem; }


.tree-detail {
  position: relative;
  overflow: hidden;
  margin-top: 3.5rem;
  padding: clamp(1.5rem, 4vw, 2.7rem);
  border: 1px solid rgba(122, 139, 255, 0.24);
  border-radius: 24px;
  background:
    radial-gradient(circle at 90% 0%, rgba(118, 104, 255, 0.15), transparent 22rem),
    linear-gradient(145deg, rgba(20, 29, 49, 0.96), rgba(12, 18, 31, 0.98));
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.27);
}

.tree-detail::after {
  content: "";
  position: absolute;
  right: -7rem;
  bottom: -8rem;
  width: 20rem;
  height: 20rem;
  border: 1px solid rgba(49, 216, 188, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.tree-detail__heading {
  position: relative;
  z-index: 1;
}

.tree-detail__status {
  display: inline-block;
  margin-bottom: 0.55rem;
  color: #8fe9d8;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tree-detail h3 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

.tree-detail__summary {
  position: relative;
  z-index: 1;
  max-width: 850px;
  margin-top: 1.2rem;
}

.tree-detail__summary p {
  margin: 0;
  color: #b3bfd1;
  font-size: 1rem;
  line-height: 1.75;
}

.tree-detail__summary p + p {
  margin-top: 1.15rem;
}

.tree-detail__points {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1.25rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.tree-detail__points li {
  position: relative;
  padding-left: 1.15rem;
  color: #d1d8e4;
  line-height: 1.55;
}

.tree-detail__points li::before {
  content: "";
  position: absolute;
  top: 0.67em;
  left: 0;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--tree-teal);
  box-shadow: 0 0 11px rgba(49, 216, 188, 0.65);
}

.tree-detail__tags {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.tree-detail__tags span {
  padding: 0.5rem 0.68rem;
  border: 1px solid rgba(151, 165, 255, 0.17);
  border-radius: 999px;
  background: rgba(122, 105, 255, 0.07);
  color: #c8ceff;
  font-size: 0.76rem;
  font-weight: 700;
}

.experience-story {
  padding: clamp(5rem, 9vw, 8rem) 0;
  background:
    radial-gradient(circle at 12% 80%, rgba(49, 216, 188, 0.10), transparent 28rem),
    #080c14;
}

.experience-story__layout {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}

.experience-story__content p:not(.tree-eyebrow) {
  margin: 1.25rem 0 0;
  color: var(--tree-muted);
  line-height: 1.8;
}

.experience-story__impact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.experience-story__impact article {
  min-height: 155px;
  padding: 1.35rem;
  border: 1px solid var(--tree-border);
  border-radius: 19px;
  background: rgba(15, 22, 37, 0.78);
}

.experience-story__impact strong {
  display: block;
  margin-bottom: 0.6rem;
  color: #ffffff;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  letter-spacing: -0.045em;
}

.experience-story__impact span {
  color: #9eabc0;
  line-height: 1.5;
}

.tree-cta {
  padding: 4.5rem 0;
  background:
    linear-gradient(135deg, rgba(119, 104, 255, 0.13), rgba(49, 216, 188, 0.06)),
    #0d1220;
}

.tree-cta__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.tree-cta h2 {
  max-width: 800px;
  font-size: clamp(2rem, 4.7vw, 3.8rem);
}


/* --------------------------------------------------------------------------
 * Compact desktop tree layout
 * Nodes size to their content rather than stretching to fill grid tracks.
 * Parent-child relationships keep vertical bottom-to-top anchors.
 * -------------------------------------------------------------------------- */
@media (min-width: 1081px) {
  .skill-tree {
    grid-template-columns: minmax(0, 3.25fr) minmax(245px, 0.9fr);
    column-gap: 3.5rem;
    min-height: 1320px;
  }

  .tree-node {
    width: max-content;
    max-width: 100%;
    padding: 0.62rem 0.72rem;
    border-radius: 14px;
  }

  .tree-node strong {
    margin-top: 0.26rem;
  }

  .tree-node small {
    margin-top: 0.24rem;
    max-width: 18rem;
  }

  .tree-node--root {
    width: max-content;
    padding: 0.7rem 0.9rem;
  }

  .tree-node--software {
    width: max-content;
    max-width: none;
    align-self: center;
    padding: 0.68rem 0.86rem;
  }

  .tree-node--software .tree-node__icon {
    position: static;
    margin: 0 0 0.35rem;
  }

  .tree-node--branch,
  .tree-node--subbranch,
  .tree-node--platform,
  .tree-node--child {
    width: max-content;
    max-width: 100%;
  }

  .tree-platforms {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 1.65rem;
    margin-top: 5.5rem;
  }

  .tree-platforms .tree-node {
    flex: 0 0 auto;
  }

  .tree-specialisms {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2.8rem;
    margin-top: 7rem;
  }

  .tree-specialism {
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: center;
  }

  .tree-specialism > .tree-node {
    align-self: center;
  }

  .tree-specialism .tree-children {
    display: grid;
    width: max-content;
    max-width: none;
    gap: 1rem;
    margin-top: 4.25rem;
    padding-top: 0;
  }

  .tree-specialism--data .tree-children {
    grid-template-columns: repeat(3, max-content);
  }

  .tree-specialism--geo .tree-children {
    grid-template-columns: repeat(2, max-content);
  }

  .tree-specialism .tree-node--child {
    padding: 0.58rem 0.64rem;
  }

  .tree-specialism .tree-node--child small {
    max-width: 9.5rem;
  }

  /* Industry / leadership branch: keep every node content-sized. */
  .tree-branch--people {
    align-items: center;
  }

  .tree-branch--people > .tree-node,
  .tree-people-group > .tree-node,
  .tree-people-grid .tree-node--child {
    width: max-content;
    max-width: 100%;
  }

  .tree-branch--people > .tree-node {
    align-self: center;
  }

  .tree-people-grid {
    width: 100%;
    justify-items: center;
  }

  .tree-people-group {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .tree-people-group .tree-children {
    width: max-content;
    max-width: 100%;
    justify-items: center;
  }

  .tree-people-grid .tree-node--child {
    padding-inline: 0.68rem;
  }

  .tree-people-grid .tree-node--child small {
    max-width: 12rem;
  }
}

@media (max-width: 1080px) {
  .skill-tree {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    min-height: 0;
    gap: 1.25rem;
    padding-left: 2.7rem;
  }

  .skill-tree::before {
    content: "";
    position: absolute;
    top: 2rem;
    bottom: 1rem;
    left: 1.15rem;
    width: 2px;
    background: linear-gradient(
      to bottom,
      rgba(136, 120, 255, 0.55),
      rgba(49, 216, 188, 0.16)
    );
  }

  .skill-tree__connections {
    display: none;
  }

  .tree-node--root {
    grid-column: 1 / -1;
    grid-row: auto;
    align-items: flex-start;
    text-align: left;
  }

  .tree-node--software {
    width: 100%;
    align-self: stretch;
  }

  .tree-branch,
  .tree-branch--software,
  .tree-branch--people {
    grid-column: auto;
    grid-row: auto;
  }

  .tree-platforms,
  .tree-specialisms,
  .tree-people-grid {
    grid-template-columns: 1fr;
  }

  .tree-branch::before,
  .tree-node--root::before {
    content: "";
    position: absolute;
    top: 2.6rem;
    left: -1.55rem;
    width: 1.55rem;
    height: 2px;
    background: rgba(119, 132, 255, 0.45);
  }
}

@media (max-width: 760px) {
  .tree-shell {
    width: min(100% - 1.5rem, 1240px);
  }

  .tree-hero {
    min-height: auto;
    padding: 7.5rem 0 4.5rem;
  }

  .tree-hero h1 {
    font-size: clamp(3rem, 17vw, 5rem);
  }

  .skill-tree-header,
  .experience-story__layout {
    grid-template-columns: 1fr;
  }

  .skill-tree {
    grid-template-columns: 1fr;
  }

  .tree-detail__points,
  .experience-story__impact {
    grid-template-columns: 1fr;
  }

  .tree-cta__inner {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .tree-hero__actions,
  .tree-button {
    width: 100%;
  }

  .tree-hero__legend {
    align-items: flex-start;
    flex-direction: column;
  }

  .skill-tree {
    padding-left: 2.1rem;
  }

  .skill-tree::before {
    left: 0.7rem;
  }

  .tree-branch::before,
  .tree-node--root::before {
    left: -1.4rem;
    width: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tree-node,
  .tree-button {
    transition: none;
  }
}

/* Relationship colours remain subtle until a node is selected. */
.skill-tree__connections path.connection--core,
.skill-tree__connections path.connection--platform {
  stroke: rgba(137, 150, 255, 0.58);
}

.skill-tree__connections path.connection--data {
  stroke: rgba(86, 168, 255, 0.68);
}

.skill-tree__connections path.connection--geo {
  stroke: rgba(49, 216, 188, 0.68);
}

.skill-tree__connections path.connection--utilities {
  stroke: rgba(244, 200, 106, 0.68);
}

.skill-tree__connections path.connection--people {
  stroke: rgba(229, 127, 203, 0.54);
}

.skill-tree__connections path.connection--cross {
  stroke: rgba(244, 200, 106, 0.64);
  stroke-dasharray: 7 7;
}

.skill-tree__connections path.connection--data,
.skill-tree__connections path.connection--geo,
.skill-tree__connections path.connection--utilities {
  stroke-width: 2.1;
}

/*
 * Idle connector colours inherit from the parent node rather than the child.
 * Active routes still use the shared teal highlight defined above.
 */
.skill-tree__connections path.connection-parent--root,
.skill-tree__connections path.connection-parent--software {
  stroke: rgba(136, 120, 255, 0.58);
}

.skill-tree__connections path.connection-parent--web,
.skill-tree__connections path.connection-parent--data {
  stroke: rgba(86, 168, 255, 0.62);
}

.skill-tree__connections path.connection-parent--mobile,
.skill-tree__connections path.connection-parent--geo {
  stroke: rgba(49, 216, 188, 0.62);
}

.skill-tree__connections path.connection-parent--desktop {
  stroke: rgba(168, 137, 255, 0.62);
}

.skill-tree__connections path.connection-parent--games,
.skill-tree__connections path.connection-parent--leadership,
.skill-tree__connections path.connection-parent--industry {
  stroke: rgba(229, 127, 203, 0.58);
}

.skill-tree__connections path.connection-parent--utilities {
  stroke: rgba(244, 200, 106, 0.64);
}

/* --------------------------------------------------------------------------
 * Three-branch desktop composition
 * Software remains the primary branch on the left, while the existing
 * industry and mentoring content are separated into two independent branches.
 * -------------------------------------------------------------------------- */
@media (min-width: 1081px) {
  .skill-tree {
    grid-template-columns: minmax(0, 3.5fr) minmax(210px, 0.72fr) minmax(210px, 0.72fr);
    column-gap: 3.25rem;
  }

  .tree-branch--software {
    grid-column: 1;
  }

  .tree-branch--industry {
    grid-column: 2;
  }

  .tree-branch--mentoring {
    grid-column: 3;
  }

  .tree-branch--industry,
  .tree-branch--mentoring {
    align-items: center;
  }

  .tree-branch--industry > .tree-node,
  .tree-branch--mentoring > .tree-node,
  .tree-branch--industry .tree-node--child,
  .tree-branch--mentoring .tree-node--child {
    width: max-content;
    max-width: 100%;
  }

  .tree-branch--industry > .tree-node,
  .tree-branch--mentoring > .tree-node {
    align-self: center;
  }

  .tree-branch--industry .tree-people-grid,
  .tree-branch--mentoring .tree-people-grid {
    width: 100%;
    justify-items: center;
  }

  .tree-branch--industry .tree-children,
  .tree-branch--mentoring .tree-children {
    width: max-content;
    max-width: 100%;
    justify-items: center;
  }

  .tree-node strong {
    font-size: 1rem;
  }

  .tree-node small {
    font-size: 0.84rem;
  }

  .tree-node--child strong {
    font-size: 1.45rem;
  }

  .tree-node--child small {
    font-size: 1.1rem;
  }

  .tree-node__icon,
  .tree-node__platform-icon {
    transform: scale(1.14);
    transform-origin: left top;
    margin-bottom: 0.62rem;
  }
}

@media (max-width: 1080px) {
  .tree-branch--industry,
  .tree-branch--mentoring {
    grid-column: auto;
    grid-row: auto;
  }
}


/* --------------------------------------------------------------------------
 * Connector readability and active-flow pulse
 * -------------------------------------------------------------------------- */

/*
 * These compact nodes sit directly above several converging SVG paths.
 * Keep their surfaces fully opaque even while the rest of the tree is dimmed.
 * Only the text content is softened; the button itself never becomes transparent.
 */
.tree-branch--industry .tree-node--child,
.tree-branch--mentoring .tree-node--child {
  isolation: isolate;
  background-color: #0e121f;
  background-image:
    linear-gradient(145deg, rgb(25, 25, 43), rgb(14, 18, 31));
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

/* Override the global opacity fade that was revealing SVG lines underneath. */
.tree-branch--industry .tree-node--child.is-dimmed,
.tree-branch--mentoring .tree-node--child.is-dimmed {
  opacity: 1;
  filter: none;
}

.tree-branch--industry .tree-node--child.is-dimmed > *,
.tree-branch--mentoring .tree-node--child.is-dimmed > * {
  opacity: 0.48;
  filter: saturate(0.72);
}

.tree-branch--industry .tree-node--child > *,
.tree-branch--mentoring .tree-node--child > * {
  position: relative;
  z-index: 1;
  transition: opacity 180ms ease, filter 180ms ease;
}

.tree-branch--industry .tree-node--child.is-selected > *,
.tree-branch--industry .tree-node--child.is-connected > *,
.tree-branch--mentoring .tree-node--child.is-selected > *,
.tree-branch--mentoring .tree-node--child.is-connected > * {
  opacity: 1;
  filter: none;
}

.connection-pulse {
  fill: #8ff6e2;
  opacity: 0;
  pointer-events: none;
  filter:
    drop-shadow(0 0 3px rgba(143, 246, 226, 0.95))
    drop-shadow(0 0 9px rgba(49, 216, 188, 0.78));
  transition: opacity 90ms linear;
}

.connection-pulse.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .connection-pulse {
    display: none;
  }
}

/* --------------------------------------------------------------------------
 * Keep people-branch connectors behind their nodes
 * --------------------------------------------------------------------------
 * The SVG connector layer must sit beneath the complete Industry and Mentoring
 * branch stacking contexts. This prevents idle lines and pulse markers from
 * being painted over the node surfaces or their text.
 */
.skill-tree__connections {
  z-index: 0;
}

.tree-node--root,
.tree-branch--software,
.tree-branch--industry,
.tree-branch--mentoring {
  position: relative;
  z-index: 2;
}

.tree-branch--industry .tree-node,
.tree-branch--mentoring .tree-node {
  position: relative;
  z-index: 3;
}


/* --------------------------------------------------------------------------
 * Scannable long-form experience summaries
 * --------------------------------------------------------------------------
 * Gold emphasis draws attention to outcomes, achievements and key lessons
 * without changing the wording or turning the summary into a wall of bold text.
 */
.tree-detail__highlight {
  padding: 0 0.08em;
  border-radius: 0.18em;
  background: linear-gradient(
    180deg,
    transparent 56%,
    rgba(244, 200, 106, 0.16) 56%
  );
  color: #f4c86a;
  font-weight: 750;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-shadow: 0 0 14px rgba(244, 200, 106, 0.12);
}

/* --------------------------------------------------------------------------
 * Mobile miniature tree
 * --------------------------------------------------------------------------
 * Smaller screens retain the complete desktop-style composition. The tree is
 * rendered at a fixed design width and proportionally scaled by JavaScript to
 * fit the available viewport, preserving all branches, connections and pulses.
 * The detail panel remains full-size beneath the overview for readability.
 * -------------------------------------------------------------------------- */
.skill-tree-viewport {
  position: relative;
  width: 100%;
  overflow: visible;
}

.skill-tree-stage {
  position: relative;
  width: 100%;
}

@media (max-width: 1080px) {
  .skill-tree-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.75rem 0.75rem 1.1rem;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(136, 120, 255, 0.55) rgba(255, 255, 255, 0.05);
    -webkit-overflow-scrolling: touch;
  }

  .skill-tree-viewport::-webkit-scrollbar {
    height: 0.55rem;
  }

  .skill-tree-viewport::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
  }

  .skill-tree-viewport::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(136, 120, 255, 0.55);
  }

  .skill-tree-stage {
    flex: 0 0 auto;
    margin-inline: auto;
  }

  .skill-tree {
    --tree-mobile-scale: 1;
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 1680px;
    max-width: none;
    min-height: 1380px;
    grid-template-columns: minmax(0, 3.5fr) minmax(210px, 0.72fr) minmax(210px, 0.72fr);
    grid-template-rows: auto auto;
    gap: 6rem 3.25rem;
    padding: 2rem 7rem 1.25rem;
    transform: scale(var(--tree-mobile-scale));
    transform-origin: top left;
  }

  /* Remove the former vertical mobile-list guide. */
  .skill-tree::before,
  .tree-branch::before,
  .tree-node--root::before {
    content: none;
    display: none;
  }

  .skill-tree__connections {
    display: block;
  }

  .tree-node {
    width: max-content;
    max-width: 100%;
    padding: 0.62rem 0.72rem;
    border-radius: 14px;
  }

  /*
   * Mobile overview text is intentionally larger than the desktop source
   * sizing. It is reduced by the tree scale along with the nodes, so the
   * larger source size keeps labels readable without changing the layout.
   */
  .tree-node strong {
    margin-top: 0.28rem;
    color: #ffffff;
    font-size: 1.55rem;
    font-weight: 850;
    line-height: 1.16;
  }

  .tree-node small {
    max-width: 19rem;
    margin-top: 0.28rem;
    color: #b8c3d5;
    font-size: 1.2rem;
    font-weight: 650;
    line-height: 1.38;
  }

  .tree-node__status {
    min-height: 1.7rem;
    padding: 0.3rem 0.62rem;
    font-size: 0.74rem;
  }

  .tree-node--root {
    grid-column: 1 / -1;
    grid-row: 1;
    width: max-content;
    padding: 0.7rem 0.9rem;
    align-items: center;
    justify-self: center;
    text-align: center;
  }

  .tree-branch {
    grid-row: 2;
  }

  .tree-branch--software {
    grid-column: 1;
  }

  .tree-branch--industry {
    grid-column: 2;
  }

  .tree-branch--mentoring {
    grid-column: 3;
  }

  .tree-node--software {
    width: max-content;
    max-width: none;
    padding: 0.68rem 0.86rem;
    align-self: center;
  }

  .tree-node--software .tree-node__icon {
    position: static;
    margin: 0 0 0.35rem;
  }

  .tree-node--branch,
  .tree-node--subbranch,
  .tree-node--platform,
  .tree-node--child {
    width: max-content;
    max-width: 100%;
  }

  .tree-platforms {
    display: flex;
    grid-template-columns: none;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.65rem;
    margin-top: 5.5rem;
  }

  .tree-platforms .tree-node {
    flex: 0 0 auto;
  }

  .tree-specialisms {
    display: flex;
    grid-template-columns: none;
    justify-content: center;
    align-items: flex-start;
    gap: 2.8rem;
    margin-top: 7rem;
  }

  .tree-specialism {
    display: flex;
    min-width: 0;
    flex: 0 1 auto;
    flex-direction: column;
    align-items: center;
  }

  .tree-specialism > .tree-node {
    align-self: center;
  }

  .tree-specialism .tree-children {
    display: grid;
    width: max-content;
    max-width: none;
    gap: 1rem;
    margin-top: 4.25rem;
    padding-top: 0;
  }

  .tree-specialism--data .tree-children {
    grid-template-columns: repeat(3, max-content);
  }

  .tree-specialism--geo .tree-children {
    grid-template-columns: repeat(2, max-content);
  }

  .tree-specialism .tree-node--child {
    padding: 0.58rem 0.64rem;
  }

  .tree-specialism .tree-node--child small {
    max-width: 9.5rem;
  }

  .tree-branch--industry,
  .tree-branch--mentoring {
    align-items: center;
  }

  .tree-branch--industry > .tree-node,
  .tree-branch--mentoring > .tree-node,
  .tree-branch--industry .tree-node--child,
  .tree-branch--mentoring .tree-node--child {
    width: max-content;
    max-width: 100%;
  }

  .tree-branch--industry > .tree-node,
  .tree-branch--mentoring > .tree-node {
    align-self: center;
  }

  .tree-branch--industry .tree-people-grid,
  .tree-branch--mentoring .tree-people-grid {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
    justify-items: center;
    margin-top: 5rem;
  }

  .tree-branch--industry .tree-people-group,
  .tree-branch--mentoring .tree-people-group {
    display: flex;
    width: 100%;
    flex-direction: column;
    align-items: center;
  }

  .tree-branch--industry .tree-children,
  .tree-branch--mentoring .tree-children {
    display: grid;
    width: max-content;
    max-width: 100%;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.9rem;
    margin-top: 3.75rem;
    padding-top: 0.75rem;
  }

  .tree-branch--mentoring .tree-children--leadership {
    margin-top: 0;
    padding-top: 0;
  }

  .tree-node--child strong {
    font-size: 1.16rem;
  }

  .tree-node--child small {
    font-size: 0.94rem;
  }

  .tree-node__icon,
  .tree-node__platform-icon {
    transform: scale(1.14);
    transform-origin: left top;
    margin-bottom: 0.62rem;
  }
}

@media (max-width: 760px) {
  /* The overview remains miniature, while its detailed content stays readable. */
  .skill-tree {
    grid-template-columns: minmax(0, 3.5fr) minmax(210px, 0.72fr) minmax(210px, 0.72fr);
  }

  .tree-detail {
    margin-top: 2.25rem;
  }
}

/* --------------------------------------------------------------------------
 * Restrict horizontal scrolling to the miniature tree
 * --------------------------------------------------------------------------
 * The scaled stage may be wider than a phone screen, but that overflow belongs
 * exclusively to .skill-tree-viewport. The surrounding section, detail panel
 * and remainder of the page stay constrained to the normal page width.
 */
.skill-tree-section {
  max-width: 100%;
  overflow-x: clip;
}

.skill-tree-section > .tree-shell {
  min-width: 0;
  max-width: min(1240px, calc(100% - 2.5rem));
}

.skill-tree-viewport {
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  contain: inline-size;
}

.tree-detail {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.tree-detail__summary,
.tree-detail__points,
.tree-detail__tags {
  min-width: 0;
  max-width: 100%;
}

.tree-detail__summary p,
.tree-detail__points li,
.tree-detail__tags span {
  overflow-wrap: anywhere;
}

@media (max-width: 1080px) {
  .skill-tree-section > .tree-shell {
    max-width: calc(100% - 2.5rem);
  }

  .skill-tree-viewport {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
  }
}

@media (max-width: 760px) {
  .skill-tree-section > .tree-shell {
    max-width: calc(100% - 1.5rem);
  }
}

/* --------------------------------------------------------------------------
 * Final desktop-only typography and branch positioning refinement
 * --------------------------------------------------------------------------
 * Mobile/tablet rules at 1080px and below are intentionally untouched.
 * Desktop labels use the same visual hierarchy as the miniature mobile tree,
 * but scale fluidly with the available desktop width.
 * -------------------------------------------------------------------------- */
@media (min-width: 1081px) {
  .skill-tree {
    grid-template-columns:
      minmax(0, 2.9fr)
      minmax(190px, 0.78fr)
      minmax(190px, 0.78fr);
    column-gap: clamp(1.5rem, 2.1vw, 2.75rem);
  }

  .tree-node strong {
    margin-top: 0.28rem;
    color: #ffffff;
    font-size: clamp(0.92rem, 0.72vw, 1.08rem);
    font-weight: 850;
    line-height: 1.16;
  }

  .tree-node small {
    max-width: 17rem;
    margin-top: 0.28rem;
    color: #b8c3d5;
    font-size: clamp(0.74rem, 0.58vw, 0.88rem);
    font-weight: 650;
    line-height: 1.38;
  }

  .tree-node--root strong {
    font-size: clamp(1.18rem, 1.05vw, 1.42rem);
  }

  .tree-node--child strong {
    font-size: clamp(0.88rem, 0.68vw, 1.02rem);
  }

  .tree-node--child small {
    max-width: 11rem;
    font-size: clamp(0.70rem, 0.54vw, 0.82rem);
  }

  .tree-specialism .tree-node--child small {
    max-width: 9.25rem;
  }

  .tree-node__status {
    font-size: clamp(0.58rem, 0.43vw, 0.68rem);
  }

  .tree-node__icon,
  .tree-node__platform-icon {
    transform: scale(clamp(1, 0.92vw, 1.1));
    transform-origin: left top;
    margin-bottom: 0.52rem;
  }

  .tree-branch--industry,
  .tree-branch--mentoring {
    width: 100%;
    justify-self: end;
    align-items: flex-end;
  }

  .tree-branch--industry > .tree-node,
  .tree-branch--mentoring > .tree-node,
  .tree-branch--industry .tree-people-grid,
  .tree-branch--mentoring .tree-people-grid {
    margin-left: auto;
  }

  .tree-specialism--geo {
    position: relative;
    left: clamp(0.75rem, 1.35vw, 1.65rem);
  }
}