/**
 * Engineering Specs — Figma 286:574 (desktop 1200px artboard).
 * Hotspot positions match design; image swap via js/specs.js.
 * Desktop shell zoom matches team.css / about.css so the layout scales with the viewport.
 */

.tf-specs {
  --specs-design-width: 1200px;
  --specs-gutter: 16px;
  --specs-border: 1px solid rgb(255 255 255 / 0.4);
  --specs-panel-bg: rgb(0 0 0 / 0.2);
  /* Matches .tf-specs__body horizontal padding — stage breaks out to use full shell width */
  --specs-body-pad-x: 64px;

  padding-top: 0;
  padding-bottom: 64px;
}

/* Only specs.html loads this sheet — room for fixed bar + safe area */
body:has(.tf-specs__bottom-cta) {
  padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
}

.tf-specs__scale-root {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  overflow-x: clip;
}

.tf-specs__shell {
  box-sizing: border-box;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--specs-gutter);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 641px) {
  .tf-specs__shell {
    width: var(--specs-design-width);
    max-width: var(--specs-design-width);
    flex-shrink: 0;
    /* Same rule as .tf-team__shell — keeps header + stage inside the viewport when vw < 1200px */
    zoom: min(1, calc((100vw - 32px) / var(--specs-design-width)));
  }
}

.tf-specs__body {
  box-sizing: border-box;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 77px;
  padding: 48px var(--specs-body-pad-x) 64px;
  background: var(--specs-panel-bg);
}

.tf-specs__head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.tf-specs__title {
  margin: 0;
  font-family: var(--font-family-headline);
  font-weight: var(--font-weight-headline);
  font-size: 80px;
  line-height: 72px;
  color: var(--color-text-default);
  text-transform: uppercase;
}

.tf-specs__lede {
  margin: 0;
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-body);
  font-size: var(--type-body-s);
  line-height: var(--type-body-leading);
  color: var(--color-text-default);
  max-width: 100%;
}

.tf-specs__stage {
  position: relative;
  container-type: inline-size;
  container-name: specs-stage;
  box-sizing: border-box;
  aspect-ratio: 1200 / 675;
  /* Use full shell width (not just the body text column): 100% + undo body horizontal padding */
  margin-left: calc(-1 * var(--specs-body-pad-x));
  margin-right: calc(-1 * var(--specs-body-pad-x));
  /* As wide as the panel allows, up to 1200px artboard — height follows 16:9 from aspect-ratio */
  width: min(1200px, calc(100% + 2 * var(--specs-body-pad-x)));
  background: var(--color-black);
  /* Allow hotspot labels (e.g. --label-left) to extend past the artboard edge */
  overflow: visible;
}

.tf-specs__hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.tf-specs__hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tf-specs__hotspot {
  position: absolute;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 8px);
  text-align: left;
}

.tf-specs__hotspot-mark {
  box-sizing: border-box;
  flex-shrink: 0;
  /* 8.3333% of stage width — same proportion as original circular hotspot */
  width: clamp(44px, 8.3333cqw, 120px);
  aspect-ratio: 1;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 50%;
  background: #ffffff;
  color: #ff7300;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.tf-specs__hotspot:hover .tf-specs__hotspot-mark,
.tf-specs__hotspot:focus-visible .tf-specs__hotspot-mark {
  background: #ff7300;
  border-color: rgb(255 255 255 / 0.35);
  color: #ffffff;
}

.tf-specs__hotspot-label {
  flex: 1 1 auto;
  min-width: 0;
  font-family: "Fira Code", ui-monospace, monospace;
  font-size: var(--type-body-s);
  font-weight: 400;
  line-height: 1.25;
  color: rgb(255 255 255 / 0.5);
  transition: color 0.15s ease;
}

/* Label sits to the left of the circle; button box = circle only so left/top match art */
.tf-specs__hotspot--label-left {
  overflow: visible;
}

.tf-specs__hotspot--label-left .tf-specs__hotspot-label {
  position: absolute;
  right: 100%;
  top: 50%;
  margin-right: 12px;
  transform: translateY(-50%);
  flex: none;
  width: auto;
  min-width: 0;
  /* ~5em fits "Wing" on line 1 and "Geometry" on line 2; tight vs vw when the window is narrow */
  max-width: min(5em, 42vw);
  text-align: right;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.tf-specs__hotspot:hover .tf-specs__hotspot-label,
.tf-specs__hotspot:focus-visible .tf-specs__hotspot-label {
  color: rgb(255 255 255 / 1);
}

.tf-specs__hotspot:focus {
  outline: none;
}

.tf-specs__hotspot:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: 3px;
}

.tf-specs__hotspot-num {
  font-family: var(--font-family-body);
  font-weight: 700;
  font-size: clamp(28px, 5vw, 60px);
  line-height: 1;
}

.tf-specs__bottom-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 20px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgb(0 0 0 / 0.94);
  border-top: 1px solid rgb(255 255 255 / 0.22);
}

.tf-specs__bottom-cta-inner {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  max-width: min(1200px, 100%);
}

.tf-specs__bottom-cta-lede {
  margin: 0;
  font-family: var(--font-family-body);
  font-weight: var(--font-weight-body);
  font-size: var(--type-body-s);
  line-height: var(--type-body-leading);
  color: var(--color-text-default);
}

/* Orange block button — sharp corners; hex for :visited */
a.tf-specs__bottom-cta-btn:any-link {
  box-sizing: border-box;
  display: inline-block;
  margin: 0;
  padding: 10px 22px;
  border: none;
  border-radius: 0;
  background: #ff7300;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  font-family: var(--font-family-body);
  font-weight: 400;
  font-size: var(--type-body-s);
  line-height: 1.2;
  text-decoration: none;
  letter-spacing: 0.03em;
}

a.tf-specs__bottom-cta-btn:hover {
  background: #ff8a26;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
}

a.tf-specs__bottom-cta-btn:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

@media (max-width: 640px) {
  body:has(.tf-specs__bottom-cta) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .tf-specs {
    --specs-body-pad-x: 16px;
    padding-top: 0;
    padding-bottom: 32px;
  }

  .tf-specs__body {
    gap: 40px;
    padding: 24px var(--specs-body-pad-x);
  }

  .tf-specs__head {
    gap: 6px;
  }

  .tf-specs__title {
    font-size: 36px;
    line-height: 1.1;
  }

  .tf-specs__hotspot {
    gap: 8px;
  }

  .tf-specs__hotspot-label {
    max-width: min(160px, 42vw);
  }
}
