/* The existing family tree stays connected to the hero and its three shortcuts. */
.corporate-tree .family-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(30px, 6vw, 82px);
  max-width: 1000px;
  margin: 0 auto;
  padding-bottom: 23px;
  border-bottom: 1px solid var(--line);
}

.family-hero::after {
  position: absolute;
  bottom: -5px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border: 1px solid var(--ink);
  background: var(--acid);
  content: '';
}

.corporate-tree .family-hero .corporate-intro {
  max-width: none;
  margin: 0;
  text-align: left;
}

.corporate-tree .family-hero .corporate-intro h1 {
  width: min(100%, 420px);
  max-width: none;
  margin: 0 0 16px;
}

.corporate-tree .family-hero .corporate-intro p {
  max-width: 42ch;
  margin: 0;
  padding: 0;
}

.family-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 16px;
  margin-top: 14px;
}

.family-shortcuts a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font: 700 13px/1.4 'Courier New', monospace;
  white-space: nowrap;
}

.family-shortcuts a span {
  color: var(--muted);
  font-size: 10px;
}

.family-shortcuts a:is(:hover, :focus-visible) {
  border-color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.family-shortcuts a:focus-visible,
.corporate-tree .branch-head:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.family-art {
  position: relative;
  display: grid;
  min-width: 0;
  place-items: center;
  aspect-ratio: 1.72;
  border: 1px solid var(--ink);
  background: var(--paper);
  box-shadow: 5px 5px 0 var(--ink);
  perspective: 780px;
}

.family-art-cross {
  position: absolute;
  z-index: 1;
  width: 12px;
  height: 12px;
  pointer-events: none;
}

.family-art-cross--start {
  top: 12px;
  left: 12px;
  border-top: 2px solid var(--acid);
  border-left: 2px solid var(--acid);
}

.family-art-cross--end {
  right: 12px;
  bottom: 12px;
  border-right: 2px solid var(--acid);
  border-bottom: 2px solid var(--acid);
}

.family-art-stage {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 50% 57%;
}

.family-ground {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-opacity: .35;
  stroke-width: 1;
}

.family-grid {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
}

.family-wire,
.family-mark,
.family-seam {
  fill: none;
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 2;
}

.family-wire {
  stroke: var(--acid);
  stroke-width: 3;
}

.family-wire--echo {
  stroke-width: 1;
}

.family-face {
  stroke: var(--ink);
  stroke-linejoin: round;
  stroke-width: 2;
}

.family-red-top,
.family-red-left {
  fill: var(--acid);
}

.family-red-right {
  fill: #a62d29;
}

.family-ink-top,
.family-ink-left {
  fill: #32352d;
}

.family-ink-right {
  fill: var(--ink);
}

.family-paper-top,
.family-paper-left {
  fill: var(--paper);
}

.family-paper-right {
  fill: var(--line);
}

.family-mark--light {
  stroke: var(--paper);
}

.family-mark--red {
  stroke: var(--acid);
}

.corporate-tree .family-branch-number {
  align-self: center;
  color: var(--paper);
  font: 700 11px/1 'Courier New', monospace;
}

.corporate-tree .branch-head .arrow {
  margin-left: auto;
}

.corporate-tree .branch-head:target {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .family-art-stage {
    animation: family-art-open 720ms cubic-bezier(.2,.7,.3,1) backwards;
    transition: transform 360ms cubic-bezier(.2,.7,.3,1);
  }

  .family-module--media,
  .family-module--retail,
  .family-module--technology {
    transition: transform 360ms cubic-bezier(.2,.7,.3,1);
  }

  .family-hero:has(.family-shortcuts a:nth-child(1):focus-visible) .family-module--retail,
  .family-hero:has(.family-shortcuts a:nth-child(2):focus-visible) .family-module--media,
  .family-hero:has(.family-shortcuts a:nth-child(3):focus-visible) .family-module--technology {
    transform: translateY(-8px);
  }

  @keyframes family-art-open {
    from { transform: rotateX(16deg) rotateY(-15deg) translate3d(0, 5px, -35px); }
    to { transform: rotateX(0) rotateY(0) translate3d(0, 0, 0); }
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .family-art:hover .family-art-stage {
    transform: rotateX(8deg) rotateY(-11deg) translateZ(15px);
  }

  .family-hero:has(.family-shortcuts a:nth-child(1):hover) .family-module--retail,
  .family-hero:has(.family-shortcuts a:nth-child(2):hover) .family-module--media,
  .family-hero:has(.family-shortcuts a:nth-child(3):hover) .family-module--technology {
    transform: translateY(-8px);
  }
}

@media (max-width: 640px) {
  .corporate-tree .family-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding-bottom: 18px;
  }

  .corporate-tree .family-hero .corporate-intro h1 {
    width: min(100%, 310px);
    margin-bottom: 12px;
  }

  .family-shortcuts {
    gap: 0 12px;
    margin-top: 8px;
  }

  .family-shortcuts a {
    font-size: 12px;
  }

  .family-art {
    aspect-ratio: auto;
    height: clamp(142px, 43vw, 210px);
    box-shadow: 3px 3px 0 var(--ink);
  }
  .family-hero::after {
    left: 10px;
  }
}

@media (min-width: 641px) and (max-width: 900px) {
  .corporate-tree .family-branch-number {
    display: none;
  }
}

/* A branch can grow without shifting the other links or the tree layout. */
.corporate-tree .branch:has(:focus-visible) {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

@media (min-width: 641px) and (prefers-reduced-motion: no-preference) {
  .corporate-tree .branch {
    transform-origin: center top;
    transition: transform 200ms ease-out;
  }

  .corporate-tree .branch:has(:focus-visible) {
    transform: scale(1.045);
  }
}

@media (min-width: 641px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .corporate-tree .branch:hover {
    transform: scale(1.045);
  }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  .corporate-tree .branch:hover {
    outline: 2px solid var(--acid);
    outline-offset: 3px;
  }
}
